Closed alexrobin closed 1 week ago
I find it odd that the media type is application
instead of text
considering that both JSON and XML are human readable.
https://www.rfc-editor.org/rfc/rfc2046.html tells us that
Application Media Type... is information which must be processed by an application before it is viewable or usable by a user
That's not true for JSON or XML
Yes, this is arguable, but all the following media types are already registered with IANA/IETF (see https://www.iana.org/assignments/media-types/media-types.xhtml).
application/xml
application/json
application/geo+json
application/city+json
application/gml+xml
So I think we ought to follow that pattern, or use the vendor sub-tree.
But you're right that there was ambiguity initially and that's probably why text/xml
also exists.
text/json
was never registered though.
I think one is supposed to use the vnd.
prefix as long as the type is not officially registered. GeoJSON used to be application/vnd.geo+json
for this reason.
Using vnd.ogc.
as prefix nicely ensures a conflict-free use, though I doubt it is really necessary.
For application/om+json
it may be better to add the s, since it's OMS now: application/oms+json
In addition to
application/json
andapplication/geo+json
, the following custom media types are currently defined in the draft documents:For SWE Common:
application/swe+xml
application/swe+json
application/swe+csv
application/swe+text
application/swe+binary
application/swe+protobuf
For SensorML:
application/sml+xml
application/sml+json
For the API:
application/om+json
Should we define them in the
ogc
vendor sub-tree instead? (like JSON-FG does), i.e.:application/vnd.ogc.swe+xml
application/vnd.ogc.swe+json
application/vnd.ogc.swe+csv
application/vnd.ogc.swe+text
application/vnd.ogc.swe+binary
application/vnd.ogc.swe+protobuf
application/vnd.ogc.sml+xml
application/vnd.ogc.sml+json
application/vnd.ogc.om+json