Issue - XML representation of response payload and request body #2097
Labels
media and encoding
Issues regarding media type support and how to encode data (outside of query/path params)
schema-object
xml
In the OpenAPI spec, section "XML Object",
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#xmlObject
implicitly defines default rules for the XML representation of JSON properties:
The spec does not make statements about how XML elements representing a JSON root value (the value representing the response payload, or the request body) should be represented:
Note: a JSON array as root value obviously requires a wrapper XML element containing the item XML elements; so there are two element names to choose.
PROPOSAL
(1) Section "Schema object", table "Fixed Fields", row "xml":
The constraint
"This MAY be used only on properties schemas. It has no effect on root schemas. "
is modified so that XML objects CAN be used for root schemas defining request bodies and response payloads. These schemas can be found at the following (informal) JSON paths:
Response payload:
/paths/{path}/(get|post|put|delete|options|head|patch)/responses/({return-code}|default)/content/{mediatype}/schema
Request body:
/paths/{path}/(get|post|put|delete)/requestBody/content/{mediatype}/schema
(2) The spec includes a text defining default rules for the XML representation of response payloads and request bodies.
The text was updated successfully, but these errors were encountered: