OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] (ODATA-1051) Further simplify JSON Batch Format


     [ https://issues.oasis-open.org/browse/ODATA-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Pizzo updated ODATA-1051:
---------------------------------

    Description: 
In OData-1046 we approved addition of a JSON-format for Batch requests and responses.

In the discussion we considered a format that included groups of requests as top-level JSON objects with common batch options.

We can simplify this proposal by removing this outer grouping and allowing the individual requests to specify that they are part of a particular atomicityGroup. By adding additional semantics (members of an atomicityGroup must be adjacent in a request) we can simplify construction and processing of a batch request.

Example batch request:

POST /v1.0/$batch HTTP/1.1  
{
  requests: [
    {
      id: "1",
      atomicityGroup: "atom1",
      method: "post",
      url: "/users",
      headers: {
        "Content-Type": "application/json"
      },
      body: {
        displayName: "John Smith",
        userPrincipalName: "jsmith@contoso.com"
      }
    },
    {
      id: "2",
      atomicityGroup: "atom1",
      dependsOn: ["1"],
      method: "put",
      url: "$1/photo",
      headers: {
        Content-Type: "image/jpeg"
      },
      body: "FRwvAAIAAAANAA4AFAAhAPNTUAAAAAAAAAAAAAAQUAAAAAAADHrQX+"
    },
    {
      id: "3",
      method: "get",
      url: "/groups?top=10",
      headers: {
        Accept: "application/atom+xml",
      }
    },
    {
      id: "4",
      dependsOn: ["atom1"],
      method: "get",
      url: "$1/thumbnail",
      headers: {
        Accept: "image/jpeg"
      }
    }
  ]
}


{
  responses: [
    {
      id: "1",
      status: 201,
      headers: {
        Location: "/users/jsmith"
      }
    },
    {
      id: "2",
      status: 204
    },
    {
      id: "3",
      status: 406,
      error: {
        message: "Atom Format not supported"
    },
    {
      id: "4",
      status: 200,
      headers: {
        Content-Type: "image/jpeg"
      },
      body: "FRwvAAIAAAANAA4AFAAhAPNTUAAAAAAAAAAAAAAQUAAAAAAADHrQX+"
    },
  }
}

  was:
In OData-1046 we approved addition of a JSON-format for Batch requests and responses.

In the discussion we considered a format that included groups of requests as top-level JSON objects with common batch options.

We can simplify this proposal by removing this outer grouping and allowing the individual requests to specify that they are part of a particular atomicityGroup. By adding additional semantics (members of an atomicityGroup must be adjacent in a request) we can simplify construction and processing of a batch request.

Example request:
~~~json
POST /v1.0/$batch HTTP/1.1  

{
  requests: [
    {
      id: "1",
      atomicityGroup: "atom1",
      method: "post",
      url: "/users",
      headers: {
        "Content-Type": "application/json"
      },
      body: {
        displayName: "John Smith",
        userPrincipalName: "jsmith@contoso.com"
      }
    },
    {
      id: "2",
      atomicityGroup: "atom1",
      dependsOn: ["1"],
      method: "put",
      url: "$1/photo",
      headers: {
        Content-Type: "image/jpeg"
      },
      body: "FRwvAAIAAAANAA4AFAAhAPNTUAAAAAAAAAAAAAAQUAAAAAAADHrQX+"
    },
    {
      id: "3",
      method: "get",
      url: "/groups?top=10",
      headers: {
        Accept: "application/atom+xml",
      }
    },
    {
      id: "4",
      dependsOn: ["atom1"],
      method: "get",
      url: "$1/thumbnail",
      headers: {
        Accept: "image/jpeg"
      }
    }
  ]
}

~~~

Example response:

~~~json
{
  responses: [
    {
      id: "1",
      status: 201,
      headers: {
        Location: "/users/jsmith"
      }
    },
    {
      id: "2",
      status: 204
    },
    {
      id: "3",
      status: 406,
      error: {
        message: "Atom Format not supported"
    },
    {
      id: "4",
      status: 200,
      headers: {
        Content-Type: "image/jpeg"
      },
      body: "FRwvAAIAAAANAA4AFAAhAPNTUAAAAAAAAAAAAAAQUAAAAAAADHrQX+"
    },
  }
}
~~~


> Further simplify JSON Batch Format
> ----------------------------------
>
>                 Key: ODATA-1051
>                 URL: https://issues.oasis-open.org/browse/ODATA-1051
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Bug
>          Components: JSON Format
>    Affects Versions: V4.01_CS02
>         Environment: [Proposed]
>            Reporter: Michael Pizzo
>             Fix For: V4.01_CS02
>
>
> In OData-1046 we approved addition of a JSON-format for Batch requests and responses.
> In the discussion we considered a format that included groups of requests as top-level JSON objects with common batch options.
> We can simplify this proposal by removing this outer grouping and allowing the individual requests to specify that they are part of a particular atomicityGroup. By adding additional semantics (members of an atomicityGroup must be adjacent in a request) we can simplify construction and processing of a batch request.
> Example batch request:
> POST /v1.0/$batch HTTP/1.1  
> {
>   requests: [
>     {
>       id: "1",
>       atomicityGroup: "atom1",
>       method: "post",
>       url: "/users",
>       headers: {
>         "Content-Type": "application/json"
>       },
>       body: {
>         displayName: "John Smith",
>         userPrincipalName: "jsmith@contoso.com"
>       }
>     },
>     {
>       id: "2",
>       atomicityGroup: "atom1",
>       dependsOn: ["1"],
>       method: "put",
>       url: "$1/photo",
>       headers: {
>         Content-Type: "image/jpeg"
>       },
>       body: "FRwvAAIAAAANAA4AFAAhAPNTUAAAAAAAAAAAAAAQUAAAAAAADHrQX+"
>     },
>     {
>       id: "3",
>       method: "get",
>       url: "/groups?top=10",
>       headers: {
>         Accept: "application/atom+xml",
>       }
>     },
>     {
>       id: "4",
>       dependsOn: ["atom1"],
>       method: "get",
>       url: "$1/thumbnail",
>       headers: {
>         Accept: "image/jpeg"
>       }
>     }
>   ]
> }
> {
>   responses: [
>     {
>       id: "1",
>       status: 201,
>       headers: {
>         Location: "/users/jsmith"
>       }
>     },
>     {
>       id: "2",
>       status: 204
>     },
>     {
>       id: "3",
>       status: 406,
>       error: {
>         message: "Atom Format not supported"
>     },
>     {
>       id: "4",
>       status: 200,
>       headers: {
>         Content-Type: "image/jpeg"
>       },
>       body: "FRwvAAIAAAANAA4AFAAhAPNTUAAAAAAAAAAAAAAQUAAAAAAADHrQX+"
>     },
>   }
> }



--
This message was sent by Atlassian JIRA
(v6.2.2#6258)


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]