|
|
|
|
|
by paulddraper
3326 days ago
|
|
> There is no requirement or guarantee that an array or an object are the top-level value in a JSON document. Alas, if only that were true. RFC 4627: > A JSON text is a serialized object or array. The MIME media type for JSON text is application/json. RFC 7159: > A JSON text is a serialized value. Note that certain previous specifications of JSON constrained a JSON text to be an object or an array. Implementations that generate only objects or arrays where a JSON text is called for will be interoperable in the sense that all implementations will accept these as conforming JSON texts. IIRC, Ruby's JSON parser was written to be strictly RFC 4627 compliant, and yields a parser error for non-array non-object texts. Since JSON isn't versioned so no one has any idea what "JSON" really means, or what "standard" is being followed. |
|