-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON fails to parse with a trailing comment at the end of an array #11545
Comments
I suspect this is a jsoncpp bug. I know that they don't support a "trailing" comment, the comment has to be before some real value that it can attach the comment too. That being said, there's nothing open on their repo (or maybe I'm just bad at searching). We should probably drum up a minimal repro without the Terminal involved and post this upstream |
I have a minimal repro example ready to go to file a bug at jsoncpp. But before I did, I did some searching and I cant find where trailing commas are permitted by the spec and most searches on StackOverflow indicate that they are not permitted. https://stackoverflow.com/questions/201782/can-you-use-a-trailing-comma-in-a-json-object From MDN: Maybe a better error message could be produced? |
Still happy to open the issue if you think it'd be prudent :) |
Many JSON parsers allow trailing commas as an extension to the spec, including jsoncpp with the |
Right on. I will open an with them today then. Thanks for the clarification! |
Here you go |
VScode doesn't like Windows Terminal's @nguyen-dows does this deserve an issue? |
Windows Terminal version (or Windows build number)
1.10.2714.0
Other Software
No response
Steps to reproduce
In the settings file, put a comment at the end of an object with a comma after it.
This fails:
Dropping either the
,
or the comment makes it work.Expected Behavior
Should be parsed as usual since both terminating commas and comments are allowed, or forbid trailing commas (assuming that comments are a desired feature).
Actual Behavior
The text was updated successfully, but these errors were encountered: