Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue - XML representation of response payload and request body #2097

Closed
hrennau opened this issue Jan 10, 2020 · 1 comment
Closed

Issue - XML representation of response payload and request body #2097

hrennau opened this issue Jan 10, 2020 · 1 comment
Labels
media and encoding Issues regarding media type support and how to encode data (outside of query/path params) schema-object xml

Comments

@hrennau
Copy link

hrennau commented Jan 10, 2020

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:

  • an object property is represented by an XML element with a name equal property name
  • an array value is represented by repeated XML elements, one for each array item, without wrapper element

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:

  • choice of element name
  • handling of a JSON root value which is an array

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.

@MikeRalphson MikeRalphson self-assigned this Feb 11, 2020
@handrews handrews added the media and encoding Issues regarding media type support and how to encode data (outside of query/path params) label Jan 30, 2024
@handrews
Copy link
Contributor

Closing as duplicate of #1435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
media and encoding Issues regarding media type support and how to encode data (outside of query/path params) schema-object xml
Projects
None yet
Development

No branches or pull requests

3 participants