-
Notifications
You must be signed in to change notification settings - Fork 702
Closed
Labels
Milestone
Description
Problem to solve
Currently filtering in jsonpath on multiple levels and "and"/"or" operators is not supported.
Proposal
Provided the following example JSON response from an endpoint:
{
"data": [
{
"id": 3,
"roles": [
{
"skutId": "xyz",
"description": "ffs"
},
{
"skutId": "abc",
"description": "ffs"
}
]
},
{
"id": 7,
"roles": [
{
"skutId": "xyz",
"description": "ffs"
},
{
"skutId": "lur",
"description": "ffs"
}
]
}
]
}And the following jsonpath: $.data[?(@.roles[?(@.skutId=='lur' || @.skutId=='abc')])].
Should provide an array with two elements, the de-facto content of the $.data .
Additional context and resources
The RFC 9535 proposal seems to implement this, and is done by this online JSONPath evaluator: https://jsonpath.com/ where the above example renders the expected result.
There is a crate that is pretty new and that says itself supporting the full, current RFC: https://crates.io/crates/jsonpath-rust
sjsadowski and simonzkl