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 Comments #1513

Closed
JasonDictos opened this issue Mar 13, 2019 · 8 comments · Fixed by #2212
Closed

Support for Comments #1513

JasonDictos opened this issue Mar 13, 2019 · 8 comments · Fixed by #2212
Labels
solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Milestone

Comments

@JasonDictos
Copy link

Sorry @nlohmann, you're library is too good for me to not bring up comment support again. Standards are standards, but the real world is another story. I am also faced with a company which will refuse to chose a library just because it doesn't allow for comments in the json file.

Are there any workarounds?

@nlohmann
Copy link
Owner

Not for this library, sorry.

@nlohmann nlohmann added the solution: wontfix the issue will not be fixed (either it is impossible or deemed out of scope) label Mar 13, 2019
@Anton-V-K
Copy link

The request is 2+ years old - see #376 :)
Taking into account that JSON5 is hanging around for a year, it is enough to wait until it becomes widely spread, and ask for the library upgrade once again :)

@nlohmann
Copy link
Owner

This library implements JSON as defined in RFC 8259. We do not plan to break compatibility by adding comments.

@JasonDictos
Copy link
Author

All that makes sense, but I guess I was hoping for something more basic. Perhaps just provide some way, or even an example, of how someone would customize some aspect of how the library parses. I wouldn't think you'd bother or need to make it some kind or primary feature that encroached on the standard parsing of json.

Either way I think this projectis awesome and I'd love to see it get accepted in the standard.

@gregmarr
Copy link
Contributor

https://github.com/andrew-d/json-strip is a C++ library I just found for removing comments. It can even insert whitespace to keep line/column numbers the same. I'm sure there are others.

@nlohmann nlohmann added solution: proposed fix a fix for the issue has been proposed and waits for confirmation and removed solution: wontfix the issue will not be fixed (either it is impossible or deemed out of scope) labels Jun 23, 2020
@nlohmann nlohmann reopened this Jun 23, 2020
@nlohmann nlohmann added this to the Release 3.8.1 milestone Jun 27, 2020
@jianbingfang
Copy link

such a pitty.

@nlohmann
Copy link
Owner

nlohmann commented Feb 2, 2024

Comments are supported.

@gregmarr
Copy link
Contributor

gregmarr commented Feb 2, 2024

To expand on that, there is a parameter to the parse() and verify() functions that you can set to ignore comments. See #2212 as linked above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants