Iain Sproat
Iain Sproat

Reputation: 5340

Standard defining json file extensions?

Is there a standard or specification which defines json file extensions?

I've seen .json used - is this just a commonly accepted practice or is it a requirement of some standards body for json saved in file format?

Upvotes: 6

Views: 553

Answers (1)

Donut
Donut

Reputation: 112895

According to Douglas Crockford's draft of the JSON format found here:

"A JSON parser transforms a JSON text into another representation. A
JSON parser MUST accept all texts that conform to the JSON grammar. A JSON parser MAY accept non-JSON forms or extensions."

So, it's just a commonly-accepted practice; as long as your file conforms to the JSON grammar the extension doesn't necessarily need to be *.json (although it can certainly be helpful to you and other developers if it is).

Upvotes: 4

Related Questions