How can one filter a list of items by a deeply nested value using JSONPath?
Test Data
[{
"identifiers": [
{
"extension": "foo"
}
]
},
{
"identifiers": [
{
"extension": "bar"
},
{
"extension": "baz"
}
]
}]
Expected Result
[{
"identifiers": [
{
"extension": "foo"
}
]
}]
I've tried the following, but none of them work. I used the JSONPath Tester to validate my results.
$[?(@.identifiers.[*].extension == 'foo')]
$[?(@.identifiers.*.extension == 'foo')]
$[?(@.identifiers[0].extension == 'foo')]
This
works at http://jsonpath.herokuapp.com/ when you use Goessner.
at http://jsonpath.curiousconcept.com/ I keep getting errors.