Internet-Draft | REST API mediatypes | September 2021 |
Polli | Expires 19 March 2022 | [Page] |
This document register the following media-types used in APIs on the IANA MEdia Types registry: text/yaml, application/yaml, application/openapi+json, and application/openapi+yaml¶
RFC EDITOR: please remove this section before publication¶
Discussion of this draft takes place on the HTTP working group mailing list (httpapi@ietf.org), which is archived at https://lists.w3.org/Archives/Public/ietf-httpapi-wg/.¶
The source code and issues list for this draft can be found at https://github.com/ioggstream/draft-polli-rest-api-mediatypes.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 19 March 2022.¶
Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
OpenAPI [oas] version 3 and above is a consolidated standard for describing HTTP APIs using the JSON [JSON] and yaml [yaml] data format.¶
To increase interoperability when processing API specifications
and leverage content negotiation mechanisms when exchanging
OpenAPI resources
this specification register the following media-types:
text/yaml
,
application/yaml
,
application/openapi+json
and application/openapi+yaml
.¶
The¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. These words may also appear in this document in lower case as plain English words, absent their normative meanings.¶
This document uses the Augmented BNF defined in [RFC5234] and updated by [RFC7405].¶
The OpenAPI Media Types convey OpenAPI specification files as defined in [oas] for version 3.0.0 and above.¶
Those files can be serialized in JSON or [yaml].
Since there are multiple OpenAPI Specifications versions,
those media-types support the version
parameter.¶
The following examples conveys the desire of a client to receive an OpenAPI resource preferably in the following order:¶
Accept: application/openapi+yaml;version=3.1, application/openapi+yaml;version=3.0;q=0.5, application/openapi+json;q=0.3¶
Security requirements for both media type and media type suffix registrations are discussed in Section 4.6 of [MEDIATYPE].¶
This specification defines the following new Internet media types [MEDIATYPE].¶
Type name: application¶
Subtype name: yaml¶
Required parameters: None¶
Optional parameters: None; unrecognized parameters should be ignored¶
Encoding considerations: Same as [JSON]¶
Security considerations: see Section 2 of this document¶
Interoperability considerations: None¶
Published specification: (this document)¶
Applications that use this media type: HTTP¶
Fragment identifier considerations: Same as for application/json [JSON]¶
Additional information:¶
Deprecated alias names for this type: application/x-yaml¶
Magic number(s): n/a¶
File extension(s): yaml, yml¶
Macintosh file type code(s): n/a¶
Person and email address to contact for further information: See Authors' Addresses section.¶
Intended usage: COMMON¶
Restrictions on usage: None.¶
Author: See Authors' Addresses section.¶
Change controller: n/a¶
Type name: text¶
Subtype name: yaml¶
Required parameters: None¶
Optional parameters: None; unrecognized parameters should be ignored¶
Encoding considerations: Same as [JSON]¶
Security considerations: see Section 2 of this document¶
Interoperability considerations: None¶
Published specification: (this document)¶
Applications that use this media type: HTTP¶
Fragment identifier considerations: Same as for application/json [JSON]¶
Additional information:¶
Deprecated alias names for this type: text/x-yaml¶
Magic number(s): n/a¶
File extension(s): yaml, yml¶
Macintosh file type code(s): n/a¶
Person and email address to contact for further information: See Authors' Addresses section.¶
Intended usage: COMMON¶
Restrictions on usage: None.¶
Author: See Authors' Addresses section.¶
Change controller: n/a¶
Type name: application¶
Subtype name: openapi+json¶
Required parameters: None¶
Optional parameters: version; unrecognized parameters should be ignored¶
Encoding considerations: Same as [JSON]¶
Security considerations: see Section 2 of this document¶
Interoperability considerations: None¶
Published specification: (this document)¶
Applications that use this media type: HTTP¶
Fragment identifier considerations: Same as for application/json [JSON]¶
Additional information:¶
Deprecated alias names for this type: n/a¶
Magic number(s): n/a¶
File extension(s): json¶
Macintosh file type code(s): n/a¶
Person and email address to contact for further information: See Authors' Addresses section.¶
Intended usage: COMMON¶
Restrictions on usage: None.¶
Author: See Authors' Addresses section.¶
Change controller: n/a¶
Type name: application¶
Subtype name: openapi+yaml¶
Required parameters: None¶
Optional parameters: version; unrecognized parameters should be ignored¶
Encoding considerations: Same as [JSON]¶
Security considerations: see Section 2 of this document¶
Interoperability considerations: None¶
Published specification: (this document)¶
Applications that use this media type: HTTP¶
Fragment identifier considerations: Same as for application/json [JSON]¶
Additional information:¶
Deprecated alias names for this type: n/a¶
Magic number(s): n/a¶
File extension(s): yaml, yml¶
Macintosh file type code(s): n/a¶
Person and email address to contact for further information: See Authors' Addresses section¶
Intended usage: COMMON¶
Restrictions on usage: None.¶
Author: See Authors' Addresses section¶
Change controller: n/a¶
This specification was born from a thread created by James Manger and the subsequent discussion here https://github.com/httpwg/http-extensions/issues/885.¶
After all these years, we still lack a proper media-type for yaml. This has some security implications too (eg. wrt on identifying parsers or treat downloads)¶
Browsers and libraries implementations treats them differently.
For example Google Chrome will display pages with
Content-Type: text/yaml
and to download pages with
Content-Type: application/yaml
.¶
RFC EDITOR PLEASE DELETE THIS SECTION.¶