Are the following valid JSON texts, or must their top-level value be an array or object?
4.0
"Hello World"
true
Related questions in the past, such as What is the minimum valid JSON?, and Is this simple string considered valid JSON? have concluded that they are not. This was based on the description of the JSON format in RFC-4627, which states that:
2. JSON Grammar
A 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.
JSON-text = object / array
These are the six structural characters:
[...]
However, the RFC-4627 status declares that it "does not specify an Internet standard of any kind". Instead, the official standard for JSON is the recently-published ECMA-404. Unlike RFC-4627, ECMA-404's description of valid JSON text does not include any requirement that it be an object or an array. For example, the section most similar to the quote above is missing that requirement:
4 JSON Text
A JSON text is a sequence of tokens formed from Unicode code points that conforms to the JSON value grammar. The set of tokens includes six structural tokens, strings, numbers, and three literal name tokens.
The six structural tokens:
[...]
Given this new specification, are encoded non-array non-object top-level values considered valid JSON texts?
false / null / true / object / array / number / string
are all valid JSON text – Similar