Clarify wording on when encoding is used (3.0.4)#3724
Merged
ralfhandl merged 3 commits intoOAI:v3.0.4-devfrom Apr 26, 2024
Merged
Clarify wording on when encoding is used (3.0.4)#3724ralfhandl merged 3 commits intoOAI:v3.0.4-devfrom
encoding is used (3.0.4)#3724ralfhandl merged 3 commits intoOAI:v3.0.4-devfrom
Conversation
The previous wording could be read to only restrict what sort of request bodies could use an Encoding Object, while allowing that it could be used with other entities that use a Media Type Object. This emphasizes that it is only relevant to Request Body Objects, and within that, only for specific media types.
ralfhandl
approved these changes
Apr 22, 2024
mikekistler
approved these changes
Apr 23, 2024
Contributor
mikekistler
left a comment
There was a problem hiding this comment.
Looks good. 👍
I left a few minor suggestions for improvement, but I'll leave it to you to decide whether or not these are useful.
versions/3.0.4.md
Outdated
| <a name="mediaTypeExample"></a>example | Any | Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The `example` field is mutually exclusive of the `examples` field. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the schema. | ||
| <a name="mediaTypeExamples"></a>examples | Map[ `string`, [Example Object](#exampleObject) \| [Reference Object](#referenceObject)] | Examples of the media type. Each example object SHOULD match the media type and specified schema if present. The `examples` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema. | ||
| <a name="mediaTypeEncoding"></a>encoding | Map[`string`, [Encoding Object](#encodingObject)] | A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to `requestBody` objects when the media type is `multipart` or `application/x-www-form-urlencoded`. | ||
| <a name="mediaTypeEncoding"></a>encoding | Map[`string`, [Encoding Object](#encodingObject)] | A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to [Request Body Objects](#requestBodyObject), and only when the media type is `multipart` or `application/x-www-form-urlencoded`. |
Contributor
There was a problem hiding this comment.
Suggested change
| <a name="mediaTypeEncoding"></a>encoding | Map[`string`, [Encoding Object](#encodingObject)] | A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to [Request Body Objects](#requestBodyObject), and only when the media type is `multipart` or `application/x-www-form-urlencoded`. | |
| <a name="mediaTypeEncoding"></a>encoding | Map[`string`, [Encoding Object](#encodingObject)] | A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding attribute SHALL only apply to [Request Body Objects](#requestBodyObject), and only when the media type is `multipart` or `application/x-www-form-urlencoded`. |
Contributor
There was a problem hiding this comment.
There is a similar statement later in the spec:
This attribute is only applicable to
multipartandapplication/x-www-form-urlencodedrequest bodies.
Do you want to update the language there to be more consistent with this change?
Co-authored-by: Mike Kistler <mikekistler@microsoft.com>
Contributor
|
Two approvals, merged |
This was referenced Apr 26, 2024
lornajane
added a commit
that referenced
this pull request
May 1, 2024
Clarify wording on encoding field (3.1.1 port of #3724)
lornajane
added a commit
that referenced
this pull request
May 1, 2024
Clarify wording on encoding field (3.2.0 port of #3724)
This was referenced May 21, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #3421
The previous wording could be read to only restrict what sort of request bodies could use an Encoding Object, while allowing that it could be used with other entities that use a Media Type Object.
This emphasizes that it is only relevant to Request Body Objects, and within that, only for specific media types.
NOTE: I am aware that the internal links are wrong. I am assuming that we will fix all of those at once at some point, so I opted to be consistent for now.
I will port this to 3.1.1 and 3.2.0 if it is accepted.