openmobilityfoundation / mds-openapi

OpenAPI description for MDS data feeds, managed by the Open Mobility Foundation.
https://openmobilityfnd.stoplight.io/docs/mds-openapi
Other
8 stars 2 forks source link

Media type in OpenAPI #34

Closed thekaveman closed 1 year ago

thekaveman commented 1 year ago

UPDATE

See comment below https://github.com/openmobilityfoundation/mds-openapi/issues/34#issuecomment-1534066482

Original

MDS defines the media type application/vnd.mds+json for use in the (response) Content-type header, and for the purposes of version negotiation whereby a client could request a particular version:

Accept application/vnd.mds+json;version=2.0

The OpenAPI endpoints thus far have used application/vnd.mds+json as the Content-type and not required it as an Accept header.

thekaveman commented 1 year ago

It seems like there is no way to distinguish the two (Accept vs. Content-type) in OpenAPI 3.1 or earlier.

Each Media Type Object defines both the request and response media type.

@schnuerle -- which should we use in the MDS OpenAPI docs?

As application/vnd.mds+json

Here we see a "Send request" link

image

Clicking that (sometimes) gives a preview

image

As application/json

Here we immediately see a preview without clicking any buttons ("Send request" is still available)

image
schnuerle commented 1 year ago

Ah I prefer the application/json render and I think it makes sense for this work to use that.

thekaveman commented 1 year ago

Great, that's what I went with!