Skip to content

Latest commit

 

History

History
61 lines (57 loc) · 2.95 KB

File metadata and controls

61 lines (57 loc) · 2.95 KB
owner handrews
name Binary
description Non-text-based media types
media_types
default_for binary
references
section anchor parentObject parentAnchor
Working with Binary Data
working-with-binary-data
Schema Object
schema-object
section anchor parentObject parentAnchor
Binary Streams
binary-streams
Media Type Object
media-type-object
section anchor parentObject parentAnchor
`Content-Transfer-Encoding` and `contentEncoding`
content-transfer-encoding-and-contentencoding
Encoding Object
encoding-object
layout default

{% capture 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. {% endcapture %}

{% capture 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. {% endcapture %}

{% include media-type-entry.md summary=summary remarks=remarks %}