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

JSon Array and Hash not working #4

Closed
lumy opened this issue Sep 9, 2014 · 3 comments
Closed

JSon Array and Hash not working #4

lumy opened this issue Sep 9, 2014 · 3 comments

Comments

@lumy
Copy link

lumy commented Sep 9, 2014

Hi,

If you put an Hash in a array Json that raise an exception.

Test 1 Work
{
"a": ["1","2"],
"b": 2 # b inline comment
}

Test 2 Don't Work
{
"a": ["1#","2"],
"b": 2 # b inline comment
}

@lumy lumy closed this as completed Sep 9, 2014
@lumy lumy reopened this Sep 9, 2014
@vaidik
Copy link
Owner

vaidik commented Jun 30, 2015

Yes correct. As a matter of fact, the existing regex would fail for anything that is not properly formatted. I will try to churn out something that handles this situation. But that's not on priority. Until then, you can split the array into multiple lines and continue to use this - a little verbose but it works.

@salty-horse
Copy link

You probably need a real "JSON with comments" parser, not a regex.

@vaidik
Copy link
Owner

vaidik commented Jul 7, 2019

Sorry for getting around to this so late. I was not maintaining commentjson in between. Got really busy with my day job. I am trying to maintain this now regularly. So expect faster responses.

This is fixed. Now there is a proper parser which addresses all these cases. You can try the latest version of commentjson which addresses this and a lot of other unhandled cases like this.

@vaidik vaidik closed this as completed Jul 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants