Skip to content
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

Support for bad commas #1429

Closed
nuzrub opened this issue Jan 14, 2019 · 3 comments
Closed

Support for bad commas #1429

nuzrub opened this issue Jan 14, 2019 · 3 comments
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead

Comments

@nuzrub
Copy link

nuzrub commented Jan 14, 2019

  • Some of the projects I work on use man-made Jsons as config files. At start it is nice, then people start to forget some commas at the end of objects/arrays. When using Newtonsoft's Json.Net, it handles it gracefully, just ignoring. When using yours, it gives me an error. Thus, I have to correct some files from time to time so that they can be read.
    I love your lib and that feature would make my life easier.

  • A minimal Json with bad commas:

{
    "A": 10,
}
           /\ Bad Comma

As I see it, the comma puts the lib in a state where it expects some other member, but it gets a } instead. Thus, the grammar must be slightly altered to allow , } as just being a }. Same goes for ,] being threated as just a ]

Thanks for the Lib :)

@OvermindDL1
Copy link

Wouldn't that be breaking the JSON spec though? I'm pretty sure there are tests where that is specifically and explicitly supposed to fail and those conformance tests would no longer pass then?

@nuzrub
Copy link
Author

nuzrub commented Jan 14, 2019

Maybe there could be a library wide switch or #define toggling this behavior.

@nlohmann
Copy link
Owner

This is a duplicate of #376. This library will not support inputs that are not conforming to RFC 8259.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead
Projects
None yet
Development

No branches or pull requests

3 participants