Does JSON have a + json suffix convention?

XML has a convention that non-standard XML-based mime types take the suffix '+ xml' (useful for syntax highlighting, etc.). This is described by RFC3023 .

I looked at RFC4626 , but I can not find mention of something like this for JSON. Does JSON have a similar convention? Is it documented somewhere?

+6
source share
5 answers

Yes, the suffix + json is described in the following RFC: http://tools.ietf.org/html/rfc6839

+3
source

There are various types of media in XML. Some of them:

  • 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 on the use of the suffix + xml, as you correctly pointed out.

Paraphrased from a wikipedia article - XML and MIME .

Update: Fixed the incorrect assumption that JSON is not used as an alternative representation for XML.

There are alternative MIME types with the widely used suffix +json . And, as rightly noted, they will continue to grow, given JSON.

The +json suffix convention is non-standard, but used by others.

+2
source

There is an ongoing specification process "application/" subtype "+json" in the JSON media type for describing the structure and meaning of JSON documents in a draft of this status record. Additional resources are available at http://json-schema.org/ .

+2
source

The GitHub API uses custom mime JSON types.

http://developer.github.com/v3/media/

You can accept their agreement.

I do not think this has been documented in the same way as with the custom XML theme. I think this is useful and that this should be documented. In the meantime, you can use them and understand that some tools do not recognize the mime type as JSON.

+1
source

I saw that such an agreement is used, yes. This is not what JSON (specification) should indicate, although perhaps later versions may offer recommendations. Most likely, it will be defined as a separate RFC.

You might want to ask this question on a mailing list such as restful-json , where there are more experts who could give a more complete answer.

0
source

Source: https://habr.com/ru/post/894651/


All Articles