Closed ioggstream closed 4 months ago
Hmm... maybe that was supposed to be Content-Encoding
? The encodings in Content-Encoding
are things like gzip (compression applied at the HTTP layer) while the encodings in contentEncoding
are application-level things like base64, base64url, or quoted-printable.
Content-Encoding
should work, as it contains an ordered list of content-coding
s. I can make a PR but dunno if we should align json-schema too.
Probably some more explanation are required because if I contentEncoding
eg. a jpeg
in base64
my understanding is that it's probably no more an HTTP Content-Type: image/jpg
but something else. In general, I finf the name contentEncoding
bearing a lot of possible different meanings in the HTTP context (again, it's jsonschema stuff probably).
WDYT?
@ioggstream JSON Schema's contentEncoding
is correct as it is. I think the only error is that I (or someone) typed Content-Type
instead of Content-Encoding
.
@ioggstream JSON Schema's
contentEncoding
is correct as it is. I think the only error is that I (or someone) typedContent-Type
instead ofContent-Encoding
.
What I don't get is
contentEncoding keyword [..] may be used to specify the Content-Encoding for the schema
json-schema has a Content-Encoding
?
@ioggstream JSON Schema's contentEncoding
keyword does something different from HTTP's Content-Encoding
header. This happens when different standards have different backgrounds and there are only so many words to use. JSON Schema's contentEncoding
uses encodings from RFC 4648 (and to a lesser degree, RFC 2045. These come from MIME's Content-Transfer-Encoding
header, which (again) is not the same as HTTP's Content-Encoding
header. But JSON Schema doesn't do transferring. Anyway, HTTP notes this issue (MIME vs HTTP headers) in RFC 7231 as well.
@handrews sure! Please check the attached PR which should clarify a bit.
PRs merged for 3.1.1 and 3.2.0 - closing!
Question
Reading the following part https://github.com/OAI/OpenAPI-Specification/blame/master/versions/3.1.0.md#L1451 it is not clear to me the meaning of the following sentence
My understanding is that it specifies the encoding used to serialize the application data before it is passed to the HTTP layer, which eventually adds one or more
content-coding
s.Is
Content-Type
the HTTP header field? In that case, iiuc its value is amedia-type
: how can I specify an encoding? Does it mean "charset"?cc: @handrews