4 ms·
> Ah crap! Deserializer blew (in most cases silently converting the number to null) Right -- the parser blew it. That many implementations do this is frustrat
by mattfenwick 13y ago
> Ah crap! Deserializer blew (in most cases silently converting the number to null)
Right -- the parser blew it. That many implementations do this is frustrating (and caused me so many problems that I ended up building my own validator for problems like this: http://mattfenwick.github.io/Miscue-js/ http://mattfenwick.github.io/Miscue-js/).
JSON doesn't set limits on number size. From RFC 4627:
An implementation may set limits on the range of numbers.
It's the implementation's fault if the number is silently converted to null.
I guess we need better implementations!
> JSON is a popular format but it's awful.
If you're willing to take the time to share, I'd love to hear more examples of JSON's problems. I'm collecting examples of problems, which I will then check for in my validator!
- stegro32 13y agoIf you're looking for examples of problems, RFC7159 (http://rfc7159.net/rfc7159 http://rfc7159.net/rfc7159) is a good place to start - just search for 'interop', as suggested by [1]. A quick look at Miscue-js suggests you already check for most of them, but you might still find something new. [1] http://www.tbray.org/ongoing/When/201x/2014/03/05/RFC7159-JSON http://www.tbray.org/ongoing/When/201x/2014/03/05/RFC7159-JS...