Skip to content

Commit 8b999d1

Browse files
authored
Merge pull request #4916 from handrews/mts
v3.2: Fix the moved Media Types section
2 parents 690560b + de84701 commit 8b999d1

File tree

1 file changed

+11
-32
lines changed

1 file changed

+11
-32
lines changed

src/oas.md

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ As these are not standards, and often contradict each other, the OAS does not at
990990
Two avenues are available for supporting such formats with `in: "querystring"`:
991991
992992
* Use `content` and `text/plain` with a schema of `type: "string"` and define the format outside of OpenAPI. While this requires more work to document and construct or parse the format, which is seen as a plain string from the OpenAPI perspective, it provides the easiest flexible option
993-
* Define a media type (which need not necessarily be [IANA-registered](https://www.rfc-editor.org/rfc/rfc6838.html)) and a process for mapping in-memory data to the serialized media type. To increase the likelihood of support across multiple tools, submit a registration for the media type and process to the OpenAPI Initiative's [Media Type Registry](#media-type-registry).
993+
* Define a media type (which need not necessarily be [IANA-registered](https://www.rfc-editor.org/rfc/rfc6838.html)) and a process for mapping in-memory data to the serialized media type. To increase the likelihood of support across multiple tools, submit a registration for the media type and process to the OpenAPI Initiative's [Media Type Registry](#openapi-media-type-registry).
994994

995995
#### Parameter Object Examples
996996

@@ -1241,7 +1241,7 @@ examples:
12411241
serializedValue: "%24.a.b%5B1%3A1%5D"
12421242
```
12431243

1244-
As there is not, as of this writing, a [registered](#media-type-registry) mapping between the JSON Schema data model and JSONPath, the details of the string's allowed structure would need to be conveyed either in a human-readable `description` field, or through a mechanism outside of the OpenAPI Description, such as a JSON Schema for the data structure to be queried.
1244+
As there is not, as of this writing, a [registered](#openapi-media-type-registry) mapping between the JSON Schema data model and JSONPath, the details of the string's allowed structure would need to be conveyed either in a human-readable `description` field, or through a mechanism outside of the OpenAPI Description, such as a JSON Schema for the data structure to be queried.
12451245

12461246
Assuming a path of `/foo` and a server of `https://example.com`, the full URL incorporating the value from `serializedValue` would be:
12471247

@@ -1319,40 +1319,19 @@ See [Working With Examples](#working-with-examples) for further guidance regardi
13191319

13201320
This object MAY be extended with [Specification Extensions](#specification-extensions).
13211321

1322-
See also the [Media Type Registry](#media-type-registry).
1323-
13241322
#### Media Types
13251323

1326-
Media type definitions are spread across several resources.
1327-
The media type definitions SHOULD be in compliance with [RFC6838](https://tools.ietf.org/html/rfc6838).
1324+
Media types are publicly registered with the [IANA media types registry](https://www.iana.org/assignments/media-types/media-types.xhtml), through process documented in [[?RFC6838]].
13281325

1329-
Some examples of possible media type definitions:
1326+
APIs also sometimes define private media types such as GitHub's `application/vnd.github.v3+json`, which are not registered, and other media types such as `application/schema+json` become widely used before an intended registration.
13301327

1331-
```text
1332-
text/plain; charset=utf-8
1333-
application/json
1334-
application/vnd.github+json
1335-
application/vnd.github.v3+json
1336-
application/vnd.github.v3.raw+json
1337-
application/vnd.github.v3.text+json
1338-
application/vnd.github.v3.html+json
1339-
application/vnd.github.v3.full+json
1340-
application/vnd.github.v3.diff
1341-
application/vnd.github.v3.patch
1342-
```
1343-
1344-
JSON-based and JSON-compatible YAML-based media types can make direct use of the [Schema Object](#schema-object) as the Object uses JSON Schema.
1345-
The use of the Schema Object with other media types is handled by mapping them into the JSON Schema [instance data model](https://www.ietf.org/archive/id/draft-bhutton-json-schema-01.html#name-instance-data-model).
1346-
These mappings may be implicit based on the media type, or explicit based on the values of particular fields.
1347-
Each mapping is addressed where the relevant media type is discussed in this section or under the [Media Type Object](#media-type-object) or [Encoding Object](#encoding-object)
1348-
1349-
##### Media Type Registry
1350-
1351-
While the [Schema Object](#schema-object) is designed to describe and validate JSON, several other media types are commonly used in APIs.
1352-
Requirements regarding support for other media types are documented in this Media Types section and in several Object sections later in this specification.
1353-
For convenience and future extensibility, these are cataloged in the OpenAPI Initiative's [Media Type Registry](https://spec.openapis.org/registry/media-type/), which indicates where in this specification the relevant requirements can be found.
1354-
1355-
See also the [Media Type Object](#media-type-object) for further information on working with specific media types.
1328+
See [Parsing and Serializing](#parsing-and-serializing) under the [Schema Object](#schema-object) for guidance on using schemas with a variety of media types.
1329+
1330+
##### OpenAPI Media Type Registry
1331+
1332+
The OpenAPI Initiative maintains a [Media Type Registry](https://spec.openapis.org/registry/media-type/) summarizing media type support expected by this specification and providing an index to which sections address which media types.
1333+
It also links to IANA registrations (where they exist) and to the most notable specification document(s) related to each media type.
1334+
Any additional media types added to this registry as extensions or for later versions of this or other OpenAPI specifications MAY be supported by implementations of this version of the OAS.
13561335

13571336
#### Complete vs Streaming Content
13581337

0 commit comments

Comments
 (0)