9 ms·
But.... * Do you accept trailing commas? * Do you accept multiline comments? * Do you accept single line comments? * Do you accept literal newlines in strin
by paulddraper 9y ago
But....
* Do you accept trailing commas?
* Do you accept multiline comments?
* Do you accept single line comments?
* Do you accept literal newlines in strings?
* Do you accept single quotes in place of double quotes?
* Do you accept integers over 8 bytes?
* Do you autodetect Unicode encoding?
* Do you accept numbers with leading zeros?
* Do you accept numbers with a leading plus sign?
* Do you accept NaN?
* Do you accept non-quoted object keys?
* Do you accept duplicate object keys?
In other words,
> A JSON parser MAY accept non-JSON forms or extensions.
https://tools.ietf.org/html/rfc7159 https://tools.ietf.org/html/rfc7159
- arghwhat 9y agoAs the quote states, none of that would be JSON. Thus, if you have a document that contains that, it is no longer JSON. A parser may accept things that are not JSON, but that's rather irrelevant. JSON does not have comments, support trailing comments, single quotes, etc. etc. etc.
- paulddraper 9y agoCertainly. And some programs may accept things are not CSVs.
- arghwhat 9y agoThe vast majority of programs support things that are not CSVs. :) (Couldn't help it.)