Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1051

Further simplify JSON Batch Format

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.01_CS02
    • Fix Version/s: V4.01_CSD02
    • Component/s: JSON Format
    • Labels:
      None
    • Environment:

      Applied

    • Proposal:
      Hide

      Remove the outer object wrapper in the proposed JSON batch format. Add an "atomicityGroup" property; all requests that have the same value for atomicityGroup are processed as an atomic unit. Members with the same atomicityGroup must be adjacent in a request payload. dependsOn can reference an individual request that is not within an atomicityGroup, or the identifier for the atomicityGroup if the request is within an atomicityGroup.

      Support server-driven paging in this format.

      For an async batch response, the nextLink can return 202 with a location header and retry after.

      Show
      Remove the outer object wrapper in the proposed JSON batch format. Add an "atomicityGroup" property; all requests that have the same value for atomicityGroup are processed as an atomic unit. Members with the same atomicityGroup must be adjacent in a request payload. dependsOn can reference an individual request that is not within an atomicityGroup, or the identifier for the atomicityGroup if the request is within an atomicityGroup. Support server-driven paging in this format. For an async batch response, the nextLink can return 202 with a location header and retry after.
    • Resolution:
      Show
      https://www.oasis-open.org/committees/download.php/60365/odata-json-format-v4.01-wd02-2017-03-24.docx

      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+"
      },
      }
      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mikep Michael Pizzo (Inactive)
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: