Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does JSON have a +json suffix convention?

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?

like image 407
Gili Avatar asked Aug 09 '11 15:08

Gili


3 Answers

Yes the +json suffix is described in the following RFC: https://www.rfc-editor.org/rfc/rfc6839

like image 134
Steffen Avatar answered Nov 17 '22 00:11

Steffen


XML has a variety of media types out there. Some common ones are:

  • XHTML (extensible hypertext markup language) application/xhtml+xml
  • SVG (scalable vector graphics) image/svg+xml
  • RSS (really simple syndication) 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.

like image 2
Ocaj Nires Avatar answered Nov 17 '22 02:11

Ocaj Nires


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/.

like image 2
Raphael Bossek Avatar answered Nov 17 '22 01:11

Raphael Bossek