Parser may ignore extra "}" brackets
Issue #90
resolved
If we load this initial config string, no problems. The extra bracket is inside of a string, and should be ignored.
"Config":"{\"Bandwidth [MBps]\":1,\"Datarate [Hz]\":10}}"
After reading “Config” though, we get this JSON which is invalid when using other JSON parsers, but throws no error using JSONtext
{"Bandwidth [MBps]":1,"Datarate [Hz]":10}}
This free online formatter shows an example of the error that would be expected from this bad formatting: https://jsonformatter.curiousconcept.com/#
Comments (2)
-
repo owner -
repo owner - changed status to resolved
Will not change
- Log in to comment
JSONtext makes the deliberate design choice to only expect a valid JSON Value in the input string (at the input Offset); it doesn't make any requirements on following characters. Other JSON interpreters may not work this way, and will throw an error on following characters.
Do you have a use case that requires throwing an error on following (non-whitespace) characters?