Hot debate today:
Is the text stream null
valid JSON?
According to http://www.ietf.org/rfc/rfc4627.txt?number=4627:
...
2. JSON GrammarA JSON text is a sequence of tokens. The set of tokens includes six structural characters, strings, numbers, and three literal names.
A JSON text is a serialized object or array.
Should this interpreted as both statements must be true in order for the text to be valid JSON?
- http://code.google.com/p/json-framework/issues/detail?id=49 seems to indicate (at the bottom) that this is invalid.
- http://json.parser.online.fr/ also flags this as invalid.
However, many other libraries seem to permit it, and indeed, it seems like a single valid token could be a legitimate result.
Is there a definitive answer?