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

Support for JSONPath Expression Filtering #86

Open
powers-alan opened this issue Aug 23, 2018 · 2 comments
Open

Support for JSONPath Expression Filtering #86

powers-alan opened this issue Aug 23, 2018 · 2 comments

Comments

@powers-alan
Copy link

Hey qntfy Crew! Does your library have any support for JSONPath expression filtering?
For example:
Input

{
  "firstName": "John",
  "lastName" : "doe",
  "age"      : 26,
  "address"  : {
    "streetAddress": "naist street",
    "city"         : "Nara",
    "postalCode"   : "630-0192"
  },
  "phoneNumbers": [
    {
      "type"  : "iPhone",
      "number": "0123-4567-8888"
    },
    {
      "type"  : "home",
      "number": "0123-4567-8910"
    }
  ]
}

Path
phoneNumbers[?(@.type == "iPhone")].number
Result

[
  "0123-4567-8888"
]

Looking through the code briefly I don't see anything that would support filtering, so I think the answer is probably no. If the library doesn't support this syntax would this be a contribution that would be welcome? Thanks!

@chilland
Copy link
Contributor

Hi @powers-alan, no we don't currently support anything like that. But yes, we are definitely open to contributions.

@JoshuaC215
Copy link
Collaborator

Hey @powers-alan just chiming in to note that this change would be most elegant in https://github.com/qntfy/jsonparser which provides underlying parsing for kazaam. Thank you!

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