kazaam
kazaam copied to clipboard
Support for JSONPath Expression Filtering
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!
Hi @powers-alan, no we don't currently support anything like that. But yes, we are definitely open to contributions.
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!