Parser may ignore extra "}" brackets

Issue #90 resolved
Tyler Wilson created an issue

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)

  1. James Powell repo owner

    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?

  2. Log in to comment