Media Type Registry
Binary: Non-text-based media types
Media Type(s):
• application/octet-stream (IANA) – RFC2045, RFC2046 §4.5.1
• audio/* (IANA) – RFC2045, RFC2046 §4.2
• image/* (IANA) – RFC2045, RFC2046 §4.2
• video/* (IANA) – RFC2045, RFC2046 §4.4
This page also applies to any unrecognized binary media type.
OAS References:
• Working with Binary Data (Schema Object)
• Binary Streams (Media Type Object)
• Content-Transfer-Encoding
and contentEncoding
(Encoding Object)
Summary
As of OAS v3.1, binary data is modeled using an empty Schema Object, in accordance with JSON Schema’s guidance regarding non-JSON instances.
Remarks
As specified in Working with Binary Data, modeling binary data that has been encoded into a string is handled differently from raw binary data, with two variations: with the Schema Object’s contentMediaType
and contentEncoding
, or with a Content-Transfer-Encoding
header in the Encoding Object (for media types that use Encoding Objects). Consult the specification for how these two mechanisms interact when they both apply.
In OAS v3.0, raw binary content was modeled as type: string, format: binary
, while type: string, format: byte
was used for base64-encoded binary. This was dropped in favor of JSON Schema draft 2020-12’s support because it did not allow specifying the media type along with the binary encoding.