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

JSONObject throws an exception when json conent has comment lines with latest json version #825

Open
sandushi opened this issue Nov 9, 2023 · 2 comments

Comments

@sandushi
Copy link

sandushi commented Nov 9, 2023

Description

We previously used json version 20070829 and we have comment lines in our json files. When we are going to upgrade json version to 20231013 , there is an exception when parsing the content to a json object.

A JSONObject text must begin with '{' at 1 [character 2 line 1]

Is there any way to upgrade the version without breaking?

@johnjaylward
Copy link
Contributor

That certainly predates this repository history. A PR would need to be made to address supporting documents with comments. This would likely need to be added as a flag on the ParserConfiguration.java and passed through to the JSONTokener to support comments going forward.

@stleary
Copy link
Owner

stleary commented Nov 10, 2023

Please see #17. I think it will be better to support comments in a fork of this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants