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

Extracting values from keys which have dot operator in their name. #15

Open
johnnash03 opened this issue Sep 21, 2015 · 2 comments
Open

Comments

@johnnash03
Copy link

This is problematic because path uses dot operator to traverse through child.So, what should be the template to extract "NAME" from the data below.

{
  "DATA": {
      "ALLNAMES": [
        {
          "LANGUAGENAME.LIST": {
            "NAME.LIST": {
              "NAME": "QWE"
            }
          }
        },
        {
          "LANGUAGENAME.LIST": {
            "NAME.LIST": {
              "NAME": "ZXC"
            }
          }
        }
      ]
  }
}
@joelvh
Copy link
Owner

joelvh commented Feb 19, 2016

@johnnash03 great use case. You could update the path pattern to accommodate this. For example, maybe the path could have square brackets around an attribute name that has a dot in it.

Example path: DATA.ALLNAMES[LANGUAGENAME.LIST][NAME.LIST]

If you had an attribute name with square brackets in it, just put it in square brackets too:

Example data:

{
  "DATA": {
      "[ALLNAMES]": []
  }
}

Example path: DATA[[ALLNAMES]]

You'd have to update the path parsing code and submit a pull request.

Are you up for it?

@joelvh
Copy link
Owner

joelvh commented Aug 3, 2017

@johnnash03 did you find a way around this?

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

2 participants