Open scottbpennell opened 2 years ago
Hello, I have a simple example of nested arrays and an expression demonstrating the issue. If arrays are not nested (it is the outer-most array) the same type of expression will work.
SAMPLE JSON { "food": [ { "appetizers": [ { "items": [ { "name": "Bruschetta", "price": "5.99" }, { "name": "Calamari", "price": "8.99" } ], "type": [ "Italian" ] } ] } ] } SAMPLE JsonPath $.food[0].appetizers[?(@.type=='Italian')].items[*].price
{ "food": [ { "appetizers": [ { "items": [ { "name": "Bruschetta", "price": "5.99" }, { "name": "Calamari", "price": "8.99" } ], "type": [ "Italian" ] } ] } ] }
$.food[0].appetizers[?(@.type=='Italian')].items[*].price
ACTUAL RESULT `[
]`
EXPECTED RESULT [ "5.99", "8.99" ]
[ "5.99", "8.99" ]
This is the part that is not working in the nested array: ?(@.type=='Italian')
I discovered it in an early version but tried it with 2.6.0 with the same incorrect results
I try this JsonPath, it works well. $.food[0].appetizers[?(@.type==['Italian'])].items[*].price
$.food[0].appetizers[?(@.type==['Italian'])].items[*].price
Hello, I have a simple example of nested arrays and an expression demonstrating the issue. If arrays are not nested (it is the outer-most array) the same type of expression will work.
SAMPLE JSON
{ "food": [ { "appetizers": [ { "items": [ { "name": "Bruschetta", "price": "5.99" }, { "name": "Calamari", "price": "8.99" } ], "type": [ "Italian" ] } ] } ] }
SAMPLE JsonPath$.food[0].appetizers[?(@.type=='Italian')].items[*].price
ACTUAL RESULT `[
]`
EXPECTED RESULT
[ "5.99", "8.99" ]
This is the part that is not working in the nested array: ?(@.type=='Italian')
I discovered it in an early version but tried it with 2.6.0 with the same incorrect results