-
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:
-
Resolution:
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:
,
body:
},
{
id: "2",
atomicityGroup: "atom1",
dependsOn: ["1"],
method: "put",
url: "$1/photo",
headers:
,
body: "FRwvAAIAAAANAA4AFAAhAPNTUAAAAAAAAAAAAAAQUAAAAAAADHrQX+"
},
{
id: "3",
method: "get",
url: "/groups?top=10",
headers:
},
{
id: "4",
dependsOn: ["atom1"],
method: "get",
url: "$1/thumbnail",
headers:
}
]
}
{
responses: [
{
id: "1",
status: 201,
headers:
},
,
{
id: "3",
status: 406,
error:
,
{
id: "4",
status: 200,
headers:
,
body: "FRwvAAIAAAANAA4AFAAhAPNTUAAAAAAAAAAAAAAQUAAAAAAADHrQX+"
},
}
}