> Scalars..In practice, many popular parsers do still implement RFC 4627 and won't parse lonely values.
Right. RFC 7159 expanded the definition of a JSON text.
> 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.
If RFC 7159 wasn't different from 4627, there'd be no reason for 7159. Same with RFC 1945 and 7230 for HTTP. (Of course, HTTP is versioned...maybe he just means to repeat the earlier versioning criticism.)
---
> it is unclear to me whether parsers are allowed to raise errors when they meet extreme values such 1e9999 or 0.0000000000000000000000000000001
And then quotes the relevant part of the RFC 7159 grammar with answers the question:
> This specification allows implementations to set limits on the range and precision of numbers accepted. Since software that implements IEEE 754-2008 binary64 (double precision) numbers [IEEE754] is generally available and widely used, good interoperability can be achieved by implementations that expect no more precision or range than these provide, in the sense that implementations will approximate JSON numbers within the expected precision. A JSON number such as 1E400 or 3.141592653589793238462643383279 may indicate potential interoperability problems, since it suggests that the software that created it expects receiving software to have greater capabilities for numeric magnitude and precision than is widely available.
Parsers may limit this however they like. And so may serializers. This includes yielding errors. (Though approximating the nearest possible 64-bit double is IMO the better choice.)
---
So yeah, in the end there is fair amount of flexibility in standard JSON.
To summarize:
> An implementation may set limits on the size of texts that it accepts.
> An implementation may set limits on the maximum depth of nesting. [this one was never mentioned though]
> An implementation may set limits on the range and precision of numbers.
> An implementation may set limits on the length and
character contents of strings.
Most implementations on 32-bit platforms will not parse 5GB JSON texts.
---
> Scalars..In practice, many popular parsers do still implement RFC 4627 and won't parse lonely values.
Right. RFC 7159 expanded the definition of a JSON text.
> 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.
If RFC 7159 wasn't different from 4627, there'd be no reason for 7159. Same with RFC 1945 and 7230 for HTTP. (Of course, HTTP is versioned...maybe he just means to repeat the earlier versioning criticism.)
---
> it is unclear to me whether parsers are allowed to raise errors when they meet extreme values such 1e9999 or 0.0000000000000000000000000000001
And then quotes the relevant part of the RFC 7159 grammar with answers the question:
> This specification allows implementations to set limits on the range and precision of numbers accepted. Since software that implements IEEE 754-2008 binary64 (double precision) numbers [IEEE754] is generally available and widely used, good interoperability can be achieved by implementations that expect no more precision or range than these provide, in the sense that implementations will approximate JSON numbers within the expected precision. A JSON number such as 1E400 or 3.141592653589793238462643383279 may indicate potential interoperability problems, since it suggests that the software that created it expects receiving software to have greater capabilities for numeric magnitude and precision than is widely available.
Parsers may limit this however they like. And so may serializers. This includes yielding errors. (Though approximating the nearest possible 64-bit double is IMO the better choice.)
---
So yeah, in the end there is fair amount of flexibility in standard JSON.
To summarize:
> An implementation may set limits on the size of texts that it accepts.
> An implementation may set limits on the maximum depth of nesting. [this one was never mentioned though]
> An implementation may set limits on the range and precision of numbers.
> An implementation may set limits on the length and character contents of strings.
Most implementations on 32-bit platforms will not parse 5GB JSON texts.