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.
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.
So
binary
andbyte
are synonyms for serializing parts of a multipart request body? Any guidance on which is the preferred synonym?Also: why does
encoding
and the Encoding Object not apply to multipart response bodies?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.
I am uncomfortable with this change. In general, I think
format: byte
means "base64 encoded" and the purpose of base64 encoding is to make the value safe for a string field.Also, the "considerations for multipart" section in 3.0.3 does not actually mention
format: byte
-- it mentionsformat: base64
, which not only is absent from the "formats defined by the OAS" table in the "Data Types" section but is not even listed in the Formats registry.My conclusion here is that the "considerations for multipart" section is actually the place to be corrected by removing
format: base64
.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.
Note: the
format: base64
typo in 3.0.3 has been corrected in 3.0.4 via #3182.Not mentioning
format: byte
here (by closing this PR without merging) would make me feel more comfortable.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.
@ralfhandl
binary
andbyte
are not synonyms, and are explained in he "Data Types" section, particularly in the "Working with Binary Data" subsection.It applies to
multipart
andapplication/x-www-form-urlencoded
, but what does that have to do with this PR?@mikekistler
It's not a change. I just made a mistake and forgot to include it and no one caught it because there had been a mistake in another part of the text which made it look like only
binary
is correct But that was wrong.The reason is that, in
multipart
,Content-Type
refers to the actual content type of the data part. The encoding that makes it safe for a string is placed inContent-Transfer-Type
. This should be a bit more clear after PR #3923. So yes, it is made safe for a string, but no, it does not change theContent-Type
header, and therefore does not change the default forcontentType
compared toformat: binary
.The spec has always stated that
format: byte
defaultsapplication/octet-stream
, and in 3.1 it states even more clearly that anycontentEncoding
(including but not limited tobase64
) defaults toapplication/octet-stream
. So this is not a change.As @ralfhandl mentioned,
base64
was always an error and had been fixed - if you look in PR #3923 you'll see it was alreadyformat: byte
in 3.0.4. I know we discussed whether to addbase64
to the registry but I guess we decided not to, and to emphasize thatbyte
was correct. I can't find the discussion right now. Either way, whetherbase64
is in the registry is irrelevant to this PR.goes with:
@ralfhandl
That would make the spec incorrect. It's inconsistent with the text from the Media Type object (which is more complete and correct in both 3.0 and 3.1) and is inconsistent with how the analogous
contentEncoding
is used in 3.1.This PR is just a bug fix.
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.
@mikekistler in response to your question in the TDC call, the
Content-Transfer-Encoding
requirement is in the last paragraph of this section (or, more accurately, it will be after PR #3923 is merged - that rendering includes both that PR and this one).And yes, I want to acknowledge that 3.0.3 was not at all clear about
Content-Transfer-Encoding
, and the inconsistent use ofbyte
andbase64
made things worse. (byte
was always what was defined in the "Data Types" section, but 3.0.3 and earlier mistakenly usedbase64
in some examples - we debated it a lot b/c obviouslybase64
is what would be used anywhere else, but we ultimately agreedbyte
was what had been intended and is what should be used.)