OAI / OAI/OpenAPI-Specification
`primaryData` attribute in Media Type Object
Nobody has claimed this yet.
- Dominant language
- Markdown
- Stars
- 31.2k
- Forks
- 9.2k
- Avg merge
- 6h 37m
- Merged PRs (30d)
- 27
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Media Type Object section in versions/3.1.0.md and review how specification changes are represented in this repository. Determine the scope of the proposed optional primaryData attribute and its effects on SDK generators; done requires an agreed specification change and corresponding tool considerations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100