Skip to content

JSon Array and Hash not working #4

Closed

Description

@lumy

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
}

Activity

  1. reopened this on Sep 9, 2014
  2. vaidik commented on Jun 30, 2015

    @vaidik
    Owner

    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.

  3. salty-horse commented on Nov 1, 2015

    @salty-horse

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

  4. vaidik commented on Jul 7, 2019

    @vaidik
    Owner

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions