XML has a convention whereby non-standard mime types based on XML take on a '+xml' suffix (useful for syntax-highlighting, etc). This is outlined by RFC3023.
I've taken a look at RFC4626 but I can't find any mention of something similar for JSON. Does JSON have a similar convention? Is it documented anywhere?
Yes the +json suffix is described in the following RFC: https://www.rfc-editor.org/rfc/rfc6839
XML has a variety of media types out there. Some common ones are:
application/xhtml+xml
image/svg+xml
application/rss+xml
Each MIME type identifies a different language.
RFC 3023 standardizes the convention of using the suffix +xml as rightly pointed out by you.
Paraphrased from the wikipedia article - XML and MIME.
Update: Removed incorrect assumption that JSON is not used as an alternative representation for XML.
There are alternate MIME types with suffix +json
being widely used. And as rightly pointed out these will continue grow considering JSON.
The +json
suffix convention is non-standard, but being used by others.
There is an ongoing specification process for "application/" subtype "+json"
in A JSON Media Type for Describing the Structure and Meaning of JSON Documents in draft status writing this. Further resources are available at http://json-schema.org/.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With