Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a media type for OpenAPI Specifications #573

Closed
mpnally opened this issue Feb 21, 2016 · 7 comments
Closed

Need a media type for OpenAPI Specifications #573

mpnally opened this issue Feb 21, 2016 · 7 comments

Comments

@mpnally
Copy link

mpnally commented Feb 21, 2016

We are implementing an API in which the body of some messages can be OpenAPI Specification "documents". For this purpose, we need a media type for OpenAPI Specifications. We would prefer to use a standard one (or more) blessed by the OpenAPI initiative rather than making up our own.

Our application requires that OpenAPI Specifications be treated as text documents, in the sense that if a specification is PUT or POSTed, a subsequent GET will return a body that is character-by-character the same as the one that was PUT (assuming someone else didn't change it in between times). This suggests to us that for this usage, a text/something media type is the right one. Our preferred format is yaml, so something like text/oas+yaml would make sense. We would probably also support text/oas+json. If we did not have the requirement of character-by-character fidelity, we might be attracted more to something in the application/something family, and it may be that different media types are needed for different usages.

@tomchristie
Copy link

Duplicate of #110

@darrelmiller
Copy link
Member

I'm not sure I understand the suggested relationship between symmetrical PUT/GET requests and the text/* media types. A server can chose to make GET/PUT symmetrical whether the media type is application/* or text/. And personally I see no reason for trying to register a text/ media type for OpenAPI.

@mpnally
Copy link
Author

mpnally commented Feb 21, 2016

Oops, sorry about the duplicate.

It seems to be hard to find clear guidance on when to use application/something versus text/something. Why do we use text/html rather than application/html? Why is there both text/xml and application/xml? RFC 3023 says this: "If an XML document -- that is, the unprocessed, source XML document -- is readable by casual users, text/xml is preferable to application/xml".

In our scenarios, the clients are treating the OAS as a text document, so text/oas+yaml makes sense to me. If our client were interested primarily in the API specified by the OAS document, rather than the document itself, text/oas+yaml would make sense to me. It would be nice if OAS allowed URLs for both the API and the OAS document to be established, as JSON Schema does. If we had that, a way to formalize what I said above would be to say that application/oas+yaml would be my preferred media type for the API itself, while text/oas+yaml would be my preferred media type for the OAS document that describes it.

@webron
Copy link
Member

webron commented Feb 22, 2016

@darrelmiller @mpnally - since this is indeed a duplicate of #110, would you mind moving this part of the discussion there? It'd make tracking things easier.

@mpnally
Copy link
Author

mpnally commented Feb 22, 2016

My fault, sorry. Should we just stop this thread, or should I also try to transfer some of this discussion to f #110 ?

@akuckartz
Copy link

@mpnally yes, do it, please.

@webron
Copy link
Member

webron commented Feb 22, 2016

I'd suggest moving the critical parts there, though the issues are linked and should be handled together. For a higher chance of this being taken under consideration, mention those there please.

Closing the ticket for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants