-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
First pass at a media types registry. #4517
base: gh-pages
Are you sure you want to change the base?
Conversation
This attempts to explain the basics of what is going on in terms of "modeling" (what you do with a Schema Object and in-memory data structures) and "mapping" (how you translate that model into something that fits a particular media type that can be serialized onto, or parsed off of, the wire). This includes some sequential / streaming formats that will be added for 3.2, as well as a selection of media types directly addressed in the OAS text. We could add more, for example `image/*` that is more-or-less identical to `application/octet-stream`, but this gives the general idea. I omitted YAML since AFAIK it is rarely used in actual API payloads, and such use is not directly mentioned in the OAS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a great initial proposal.
I think each section needs to be fleshed-out with examples, including OpenAPI schemas, representative payloads, and supporting configuration, but all of that can happen incrementally on top of this.
|
||
# Media Type Registry | ||
|
||
This registry defines how to use the Schema Object, Media Type Object, and in some cases other Objects to model media types other than `application/json` or media types using a `+json` suffix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Co-authored-by: Duncan Beevers <[email protected]>
@duncanbeevers examples, schemas, representative payloads, etc. all belong on the learn site. All of the registries are bare-bones references, and this one is in line with that pattern. Contributions to the Learn site are encouraged :-) |
@duncanbeevers I do think that if/when we have that content on the Learn site, we should link to it directly from here (and similarly for other registries). |
This attempts to explain the basics of what is going on in terms of "modeling" (what you do with a Schema Object and in-memory data structures) and "mapping" (how you translate that model into something that fits a particular media type that can be serialized onto, or parsed off of, the wire).
This includes some sequential / streaming formats that will be added for 3.2, as well as a selection of media types directly addressed in the OAS text. We could add more, for example
image/*
that is more-or-less identical toapplication/octet-stream
, but this gives the general idea.I omitted YAML since AFAIK it is rarely used in actual API payloads, and such use is not directly mentioned in the OAS.