-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Open
Labels
Needs attentionThe author has replied and people with triage rights should take action.The author has replied and people with triage rights should take action.media and encodingIssues regarding media type support and how to encode data (outside of query/path params)Issues regarding media type support and how to encode data (outside of query/path params)
Description
Media Type Object should have an optional primaryData
attribute, to specify the name of the property, where the primary data is located in the schema.
It is very common to return the response object wrapped in a top level property. This way, it is possible to provide additional metadata as well. Example:
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/User'
meta:
$ref: '#/components/schemas/Metadata'
required: ['data']
primaryData: data
The OpenApi tools could better understand these type of responses. It would be possible to express, that the data
attribute is not really part of any schemas/objects. It is just a wrapper.
The SDK Generators could benefit from this primaryData
attribute as well. At the moment, these kind of responses usually have to be manually unwrapped.
Metadata
Metadata
Assignees
Labels
Needs attentionThe author has replied and people with triage rights should take action.The author has replied and people with triage rights should take action.media and encodingIssues regarding media type support and how to encode data (outside of query/path params)Issues regarding media type support and how to encode data (outside of query/path params)