You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Range and Precision - What about numbers with a huge amount of digits? According to RFC 7159, "A JSON parser MUST accept all texts that conform to the JSON grammar" (section 9). However, according to the same paragraph, "An implementation may set limits on the range and precision of numbers.". So, it is unclear to me whether parsers are allowed to raise errors when they meet extreme values such 1e9999 or 0.0000000000000000000000000000001.
You said it is unclear to me whether parsers are allowed to raise errors but all the extreme values tests are y_* tests. Since the specification is contradictory, I think these tests should be implementation defined instead.
Some parsers, such as jansson and Json.NET has chosen to raiseerrors:
reader=new JsonTextReader(new StringReader("1E+309"));
ExceptionAssert.Throws<JsonReaderException>(()=> reader.Read(),"Input string '1E+309' is not a valid number. Path '', line 1, position 6.");reader=new JsonTextReader(new StringReader("-1E+5000"));
ExceptionAssert.Throws<JsonReaderException>(()=> reader.Read(),"Input string '-1E+5000' is not a valid number. Path '', line 1, position 8.");
The text was updated successfully, but these errors were encountered:
You said it is unclear to me whether parsers are allowed to raise errors but all the extreme values tests are
y_*
tests. Since the specification is contradictory, I think these tests should be implementation defined instead.Some parsers, such as jansson and Json.NET has chosen to raise errors:
The text was updated successfully, but these errors were encountered: