-
Notifications
You must be signed in to change notification settings - Fork 9.1k
v3.2: Allow Parameter/Header "examples" field with "content" field #4648
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
Open
handrews
wants to merge
4
commits into
OAI:v3.2-dev
Choose a base branch
from
handrews:content-examples
base: v3.2-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
baywet
approved these changes
Jun 5, 2025
Parameter and Header serialization is complex, particularly when using the `content` field to use a Media Type Object. In such scenarios, the serialization occurs in two steps: The first step is to serialize the data to the media type, which can be captured by the `examples` field of the Media Type Object. The second is the encoding/escaping of the media type document for use in a URI, HTTP header, or other location with its own rules. Sometimes the part needing illustration with an example is at one level, sometimes at another, and sometimes it is helpful to show both. For simplicity, the "data" examples are always treated as the overall input data, so they would be the same at both levels. This is also because it is not always possible to show each step, particularly when there are binary serializations. This allows showing either step (or both steps) with both data and serialization, depending on what makes sense for the use case.
Co-authored-by: Karen Etheridge <[email protected]>
ae592e3
to
e9f1322
Compare
Rebased with only minor conflicts (Git getting confused by adjacent changes, not multiple changes to the same line). |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
example obj/keywords
Issues with the Example Object or exampel(s) keywords
media and encoding
Issues regarding media type support and how to encode data (outside of query/path params)
param serialization
Issues related to parameter and/or header serialization
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: This is a companion to PR #4647 that just adds to where we can use Example Objects as the second part of the three-part proposal. It is written assuming that PR would be merged because that makes the benefit more clear, although it could technically be done even without that PR. But that would be less useful since tools do not support the serialization rules for the old example fields.
Parameter and Header serialization is complex, particularly when using the
content
field to use a Media Type Object.In such scenarios, the serialization occurs in two steps: The first step is to serialize the data to the media type, which can be captured by the
examples
field of the Media Type Object.The second is the encoding/escaping of the media type document for use in a URI, HTTP header, or other location with its own rules.
Sometimes the part needing illustration with an example is at one level, sometimes at another, and sometimes it is helpful to show both.
For simplicity, the "data" examples are always treated as the overall input data, so they would be the same at both levels. This is also because it is not always possible to show each step, particularly when there are binary serializations. This allows showing either step (or both steps) with both data and serialization, depending on what makes sense for the use case.