jsonlintdotcom
jsonlintdotcom copied to clipboard
Strings, numbers, null as top level objects should throw a warning, not an error
Essentially all JSON libraries respect these values as top level objects, even if the spec technically prohibits. We should follow suit.
'1', '"a"', 'null', 'true' and 'false' are valid JSON, according to the spec (http://www.json.org/) .
But, http://jsonlint.com/ can't parse these.
Parse error on line 1:
1
^
Expecting '{', '['
"pure JavaScript version" is ok : http://zaach.github.com/jsonlint/
From the spec at http://www.ietf.org/rfc/rfc4627.txt:
A JSON text is a serialized object or array. JSON-text = object / array
It should still show a warning though.
Ah, I have been misunderstood.
http://jsonlint.com/ is right.
Thanks.