Looking at json spec, I'm not sure whether a value
is permitted to stand alone, or is only permitted as part of object
or array
structure.
This is valid JSON:
[123]
But is this valid JSON:
123
Looking at json spec, I'm not sure whether a value
is permitted to stand alone, or is only permitted as part of object
or array
structure.
This is valid JSON:
[123]
But is this valid JSON:
123
A value is permitted to stand alone.
The rule has been changed a few years ago.
Per ECMA-404, The JSON Data Interchange Standard (pdf), which is linked from the JSON.org page you linked:
A JSON text is a sequence of tokens formed from Unicode code points that conforms to the JSON value grammar.
And:
A JSON value can be an object, array, number, string, true, false, or null.
As such, the value 123
is valid JSON, representing an integer.