Skip to content

Commit

Permalink
BatchSupported
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Dec 13, 2024
1 parent 07850ab commit 3c0e7b2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 76 deletions.
4 changes: 2 additions & 2 deletions tools/V4-CSDL-to-OpenAPI.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2454,8 +2454,8 @@
</xsl:template>

<xsl:template name="batch">
<xsl:variable name="batch-supported" select="not(//edm:Annotation[not(@Qualifier) and @target=current()/@id and @p2:Term='Org.OData.Capabilities.V1.BatchSupported']
/edm:Record/edm:PropertyValue[@Property='Supported' and @Bool='false'])" />
<xsl:variable name="batch-supported" select="//edm:Annotation[not(@Qualifier) and @target=current()/@id and @p2:Term='Org.OData.Capabilities.V1.BatchSupported']
/edm:Record/edm:PropertyValue[@Property='Supported' and not(@Bool='false')]" />
<xsl:text>"/$batch":{</xsl:text>
<xsl:if test="$batch-supported">
<xsl:text>"post":{"summary": "Send a group of requests","description": "Group multiple requests into a single request payload, see [Batch Requests](</xsl:text>
Expand Down
38 changes: 1 addition & 37 deletions tools/tests/annotations-v4.openapi3.json
Original file line number Diff line number Diff line change
Expand Up @@ -733,43 +733,7 @@
}
}
},
"/$batch": {
"post": {
"summary": "Send a group of requests",
"description": "Group multiple requests into a single request payload, see [Batch Requests](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_BatchRequests).\n\n*Please note that \"Try it out\" is not supported for this request.*",
"tags": [
"Batch Requests"
],
"requestBody": {
"required": true,
"description": "Batch request",
"content": {
"multipart/mixed;boundary=request-separator": {
"schema": {
"type": "string"
},
"example": "--request-separator\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET Orders HTTP/1.1\nAccept: application/json\n\n\n--request-separator--"
}
}
},
"responses": {
"200": {
"description": "Batch response",
"content": {
"multipart/mixed": {
"schema": {
"type": "string"
},
"example": "--response-separator\nContent-Type: application/http\n\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{...}\n--response-separator--"
}
}
},
"4XX": {
"$ref": "#/components/responses/error"
}
}
}
}
"/$batch": {}
},
"components": {
"schemas": {
Expand Down
38 changes: 1 addition & 37 deletions tools/tests/annotations.openapi3.json
Original file line number Diff line number Diff line change
Expand Up @@ -4032,43 +4032,7 @@
}
}
},
"/$batch": {
"post": {
"summary": "Send a group of requests",
"description": "Group multiple requests into a single request payload, see [Batch Requests](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_BatchRequests).\n\n*Please note that \"Try it out\" is not supported for this request.*",
"tags": [
"Batch Requests"
],
"requestBody": {
"required": true,
"description": "Batch request",
"content": {
"multipart/mixed;boundary=request-separator": {
"schema": {
"type": "string"
},
"example": "--request-separator\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET AllSet HTTP/1.1\nAccept: application/json\n\n\n--request-separator--"
}
}
},
"responses": {
"200": {
"description": "Batch response",
"content": {
"multipart/mixed": {
"schema": {
"type": "string"
},
"example": "--response-separator\nContent-Type: application/http\n\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{...}\n--response-separator--"
}
}
},
"4XX": {
"$ref": "#/components/responses/error"
}
}
}
}
"/$batch": {}
},
"components": {
"schemas": {
Expand Down

0 comments on commit 3c0e7b2

Please sign in to comment.