This seems to be one of JSON's best secrets: when can you leave quotes around the string - and what quotes (one or two) should you use anyway?
the JSON standard is pretty straightforward: use double quotes and always use them. However, no one is following this, and the parsers seem generally beautiful.
For example, keys in JSON documents usually do not need quotes. (I assume that since the parser might suggest that the key should be a string literal). But is this a rule? Are there any other rules? Are they parser specific or language specific?
Note that although the question is about JSON, this includes the standard way to express JSON objects in a given programming language. If a language (like JavaScript) has official rules that are distracted from the JSON standard, it would be useful to see them defined.
source share