Re:Myjson – A simple JSON store for your web or mobile app
by alxeder on Tuesday April 22, 2014 @12:09PM
(#7628512)
A JSON literal is also valid JSON.
Therefore 4, "test" and true should be saveable without a object wrapper
[ Parent
| on HN ]
Re:Myjson – A simple JSON store for your web or mobile app
by ajanuary on Tuesday April 22, 2014 @12:39PM
(#7628686)
To expand on that: only since RFC 7158, earlier versions required the root to be an array or object.
So if you're generating json, it's advisable to wrap it so that parsers written according to the older specs won't choke on it.
However, when parsing, like this, you want to try and accept values.