You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The library supports existence filtering expressions on arrays with simple values. For example the following is validated in the web application:
input.yaml
services:
- host: api.example.com
routes:
- methods:
- POST
name: create
- methods:
- GET
name: get
- methods:
- OPTIONS
- GET
name: getopt
Expression:
$.services[*].routes[?(@.methods[?(@=='GET')])]
Returns:
methods:
- GET
name: get
---
methods:
- OPTIONS
- GET
name: getopt
However, I cannot determine if the inner most expression can be combined with an && or || operator to check for the existence of all or any values within an array.
Verified this query should work using another jsonpath implementation and the same document in json form VS yaml: $.services[*].routes[?(@.methods=='GET' || @.methods=='POST')] , but does not work here. Confirmed there is no response.
I see this behavior also with only 1 query (not a combo with the or (||) operator: $.services[*].routes[?(@.methods=='GET')]
Describe the bug
The library supports existence filtering expressions on arrays with simple values. For example the following is validated in the web application:
input.yaml
Expression:
Returns:
However, I cannot determine if the inner most expression can be combined with an
&&
or||
operator to check for the existence of all or any values within an array.Various expressions have been tried including:
Results:
Is it possible to combine these array existence filters?
Reproduction steps
...
Expected behavior
Combining other filters appears to be supported, so I would expect this filter to return both the array items that contain a
GET
OR aPOST
operation.Additional context
No response
The text was updated successfully, but these errors were encountered: