jsoncpp icon indicating copy to clipboard operation
jsoncpp copied to clipboard

Parsing of trailing data

Open j-moeller opened this issue 1 year ago • 1 comments

Describe the bug jsoncpp parses trailing commas and ignores trailing garbage which is (technically) not in accordance with the JSON grammar.

To Reproduce We created a minimum working sample here.

Expected behavior jsoncpp should abort parsing when encountering a trailing comma or when (trailing) input is left after the parsing attempt.

j-moeller avatar Jul 03 '24 08:07 j-moeller

@j-moeller,

by default, CharReaderBuilder accepts trailing comma. You may consider invoking char_reader_builder.strictMode(&char_reader_builder.settings_) to disable this behavior.

daudrain avatar Dec 01 '24 21:12 daudrain