open-source-parsers / jsoncpp

A C++ library for interacting with JSON.
Other
8.06k stars 2.63k forks source link

Trailing comma before comment in array crashes #1500

Open jamespack opened 1 year ago

jamespack commented 1 year ago

Describe the bug Default settings_ (non strict) allows for both trailing commas and comments. However, an exception is generated on the following JSON

"actions": [
  {},
  // ...
],

To Reproduce Steps to reproduce the behavior:

  1. Minimal reproducible sample attached

TrailingCommentBug.zip

Expected behavior We expected this to be valid JSON as both the settings seem to allow for it.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.