Re: [media-types] OpenApi media type registration questions
Sean Leonard <dev+ietf@seantek.com> Tue, 08 March 2016 05:27 UTC
Return-Path: <dev+ietf@seantek.com>
X-Original-To: media-types@ietfc.amsl.com
Delivered-To: media-types@ietfc.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfc.amsl.com (Postfix) with ESMTP id A0D851CDF23 for <media-types@ietfc.amsl.com>; Mon, 7 Mar 2016 21:27:04 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.601
X-Spam-Level:
X-Spam-Status: No, score=-2.601 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.41]) by localhost (ietfc.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GcNIQPA-cPlo for <media-types@ietfc.amsl.com>; Mon, 7 Mar 2016 21:27:03 -0800 (PST)
Received: from mxout-07.mxes.net (mxout-07.mxes.net [216.86.168.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfc.amsl.com (Postfix) with ESMTPS id 33AC31CDF21 for <media-types@ietf.org>; Mon, 7 Mar 2016 21:27:03 -0800 (PST)
Received: from [192.168.123.7] (unknown [75.83.2.34]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 202AF22E253 for <media-types@ietf.org>; Tue, 8 Mar 2016 00:27:01 -0500 (EST)
To: media-types@ietf.org
References: <SNT405-EAS138D1B69D14EDBB70D8B858A3B20@phx.gbl>
From: Sean Leonard <dev+ietf@seantek.com>
Message-ID: <56DE624C.6020700@seantek.com>
Date: Mon, 07 Mar 2016 21:25:32 -0800
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <SNT405-EAS138D1B69D14EDBB70D8B858A3B20@phx.gbl>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: quoted-printable
Archived-At: <http://mailarchive.ietf.org/arch/msg/media-types/p-UZHnxbE0Ak3iW0cgHzQiTx54g>
Subject: Re: [media-types] OpenApi media type registration questions
X-BeenThere: media-types@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "IANA mailing list for reviewing Media Type \(MIME Type, Content Type\) registration requests." <media-types.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/media-types>, <mailto:media-types-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/media-types/>
List-Post: <mailto:media-types@ietf.org>
List-Help: <mailto:media-types-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/media-types>, <mailto:media-types-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 08 Mar 2016 05:27:04 -0000
On 3/7/2016 5:40 PM, Darrel Miller wrote: > As a member of the Technical Developer Community of the Open APIs Initiative > ( https://openapis.org/governance ), I am exploring options for registering > media types for the Open API specification (previously Swagger) > https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md . > > Currently this document format is in its second major revision and we are > working towards a third that is likely going to have breaking changes. The > document itself has a version property within it so there is no need for > that to appear in the media type. > > There are also two distinct representations of the OpenAPI document. One > uses the JSON format and the other uses the YAML format. It would be > desirable to distinguish between these two representations and we believe > the best approach would be to follow the precedent set by RFC 6839 and use a > +json and +yaml suffix. As +yaml is not defined with RFC 6839 and there is > no registry defined in which to add this new suffix, I am assuming a new RFC > would be needed to register this. > > As we see it, there are two different subtypes that are potentials homes for > these registrations. There is the vendor subtree and the Standards subtree. > Considering the current support and fairly broad adoption of this format and > its new home in the Linux Foundation, I would think the standards tree would > be the more appropriate place. However, any guidance on this would be > appreciated. You can put it in the Standards subtree if you want. It is slightly more work, but you can jettison the ".vnd" part. To get it in the Standards subtree, either the registration has to be based on a specification by a recognized Standards Development Organization (SDO), or published as an RFC at least at Informational level. Only the format specification has to be by a a recognized SDO--the format specification document does not have to incorporate the media type registration template. So if you already have the format in a published document, you can write the media type registration template yourself. However, it sounds like you need to publish an RFC in this case (assuming that you don't want ".vnd"). The RFC can go through IETF Consensus (i.e., go through a working group), or can go through the Independent Submission Editor as an Independent document. > > I would like to submit registrations for: > > application/openapi+json > application/openapi+yaml > > Other than the need for +yaml RFC does anyone have any objections to these? No objections, just further comments. > > One final question is related to the fact that these formats are a form of > documentation for an API and may be read directly by humans. Is it > recommended to also register text/ versions of these media types to allow > servers to communicate this intent? Regarding +yaml, adding a new structured syntax registration requires Expert Review. This means that an RFC is not required. Just fill out the template and get it reviewed and approved. Under the circumstances, however, I would recommend that a discrete YAML media type be defined if you want the structured syntax suffix. This is mainly because it seems to make sense to have a generic way to interchange YAML that is not specific to OpenAPI. I would recommend text/yaml. The distinction between text/yaml and application/yaml boils down to a few considerations: 1. Whether you want to preserve the bytes exactly "as-is", versus have media type aware processors "massage it" on the way down (e.g., manipulate or canonicalize LF <-> CRLF). 2. Whether you want media type handlers to fall back to text/plain or application/octet-stream. The former will behave like a plain text file or stream (because it is). The latter will look like an opaque blob or opaque file (because it is). 3. Whether the format itself declares the charset. In (for example) XML, <?xml version="1.0" encoding="XXX"?> declares the charset, so text/xml; charset=YYY can get out-of-sync. 3. Whether you want charset conversion services. text/yaml; charset="iso-8859-15" can get converted to (any) Unicode encoding "automagically". Per RFC 6657, the registration of the text-based media type is supposed to declare the default or preferred charset. So even if you assume YAML is "always" in Unicode, that alone is not a reason to go to application/yaml (because in text/yaml you can just declare that YAML is always in one of the Unicode encodings). Overall my opinion is on the side of text/yaml, if you register the generic type at all. You do not have to. I am not familiar with the history of YAML, but I suppose there is probably some reason why it has not been registered yet. Perhaps implementers found that text/plain worked fine for them, or for computer-to-computer interchange it was easier to exchange JSON or XML. Sean
- [media-types] OpenApi media type registration que… Darrel Miller
- Re: [media-types] OpenApi media type registration… Sean Leonard
- Re: [media-types] OpenApi media type registration… Darrel Miller
- Re: [media-types] OpenApi media type registration… Sean Leonard
- Re: [media-types] OpenApi media type registration… Darrel Miller
- [media-types] text/yaml Re: OpenApi media type re… Sean Leonard
- Re: [media-types] OpenApi media type registration… Mark Baker