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

jsonpath_ng.exceptions.JsonPathParserError: Parse error at 1:37 near token 1 (NUMBER) #123

Open
yangming9 opened this issue Apr 14, 2023 · 1 comment

Comments

@yangming9
Copy link

yangming9 commented Apr 14, 2023

my patch key contain a number as a key(but it is real a str),Can we be compatible with this format

my json example : {
    "modular": 213,
    "enable": true,
    "info":[
        {
          "feature_param_dict_list": [{
                "1" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                "2" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                "3" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                "4" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                "5" : [0],
                "6" : [0],
                "7" : [0, 0, 0, 0],
                "8" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                "9" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                "10": [0, 0]
              }
          ]
        }]
}

my path example : $.info[*].feature_param_dict_list[*].1[0]

@michaelmior
Copy link
Collaborator

You should be able to quote the 1 and use the path $.info[*].feature_param_dict_list[*].["1"][0].

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

2 participants