Skip to content

feat(spec): codify Encoding in specific requestBody mediatypes #3834

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

Closed
wants to merge 59 commits into from
Closed

feat(spec): codify Encoding in specific requestBody mediatypes #3834

wants to merge 59 commits into from

Conversation

jeremyfiel
Copy link
Contributor

@jeremyfiel jeremyfiel commented May 21, 2024

the specification indicates

The encoding object SHALL only apply to requestBody objects when the media type is multipart or application/x-www-form-urlencoded.

This PR codifies that behavior in the JSON Schema to enable validation.

Per the Development.md, this change was already merged to the Specification on this PR

@handrews handrews requested a review from a team May 21, 2024 18:33
@jeremyfiel jeremyfiel changed the base branch from v3.0.4-dev to main May 21, 2024 18:35
@jeremyfiel jeremyfiel requested a review from a team as a code owner May 21, 2024 18:35
ralfhandl and others added 10 commits May 21, 2024 18:16
* format:base64 doesn't exist -> format:byte

* Remove lines without format from Data Formats table
The IETF apparenlty decided to redo everything about publishing RFCs,
and while most of the old URLs redirect, these ones for RFC 3339
did not.  Also, there was a stray trailing '/' that broke another
RFC link.
Same fix has already been applied to 3.1.1-dev
Add a brief explanation as a subsection of Data Types, and
update the relevant examples.  Specifically:

* Don't use `format: byte` for a whole message body
* Fix `multipart/mixed` example to be `multipart/form-data`
  (because `multipart/mixed` does not name its parts and
  therefore cannot be represented with an object schema)
* Add an `application/x-www-form-urlencoded` example,
  which is where `format: byte` needs to be used
This follows up from a discussion on the OAI slack that decided:

* redefining "document" to sometimes mean multiple documents is confusing
* "description" has more support than "definition"
lornajane and others added 29 commits May 21, 2024 18:18
These should have the parameter name in the resulting string (see issue #3737).
If no Encoding Object is provided, the behavior is the same as
an empty Encoding Object, as none of its fields are required.
The "undefined" wording was chosen to allow implementations
that make a good-faith effort to accommodate non-string values
to remain compliant.  However, new implementations are not
expected to implement any sort of type coersion, and this
guides API designers away from that expectation.
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.

# Conflicts:
#	versions/3.0.4.md
The OAS does not define how to avoid collisions between parameter
values and style delimiters.  Mostly, this is straightforward,
but the need to URL encode space characters introduces extra
confusion.  Make it clear that managing this occurs outside
of the use of style, and is the responsibility of users.
This is a more natural grouping of similar types, making the data much easier to read.

# Conflicts:
#	versions/3.0.4.md
# Conflicts:
#	.gitignore
This makes the relational requirements of `content` vs `schema`
and associated fields more clear.  The mutual exclusivity requirement
is moved up to the top of the Fixed Fields section, and each table
table is given a subsection clarifying its meaning.  This makes it
easier to follow the multi-table format, which is unusual within the OAS.

The commentary on `example` and `examples` is moved to the section
on `schema` and related parameters as it appears to only apply
in that case.
Undefined means "don't use this even if it seems to work, as there
are cases where it won't."  Implementation-defined means "this isn't
portable or interoperable, but it is still correct."
and correct expansion of "auth"
This was missed in the 3.0.4 PR for this change, but caught in
the 3.1.1 and 3.2.0 versions.
This clarifies the meaning of `allowEmptyValue` as discussed in
today'd TDC call.  It is intended to indicate an agreement between
the client and server to use zero-length string values as an
indicator of unused fields.
the specification indicates
> The encoding object SHALL only apply to requestBody objects when the media type is multipart or application/x-www-form-urlencoded.

Co-authored-by: Jeremy Fiel <[email protected]>
@jeremyfiel jeremyfiel closed this by deleting the head repository May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.