Skip to content

Sub filter not working $.Order.Items[?(@.Product.IndexName=='SIM' && @.InventoryItems[?(@.StoreId==0)])] #256

@grejman

Description

@grejman

Describe the bug

When attempting to filter based on the below expretion we get no result or error. However, when we use the same expression on RFC 9535 standard, we get a result. It seems to be the condition [?(@.StoreId==0)] is not being evaluated correctly.

The following was reproduced on https://jsonpath.com/

Code sample or steps to reproduce

$.Order.Items[?(@.Product.IndexName=='SIM' && @.InventoryItems[?(@.StoreId==0)])]

Expected behaviour

We expect the following result:

[
{
"Product": {
"IndexName": "SIM"
},
"InventoryItems": [
{
"StoreId": 0
}
]
}
]

Expected result

{
"Order": {
"Items": [
{
"Product": {
"IndexName": "Mobile Subscription"
},
"InventoryItems": [
{
"StoreId": 10581
}
]
},
{
"Product": {
"IndexName": "SIM",
},
"InventoryItems": [
{
"StoreId": 0
}
]
}
]
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions