Open BenjaminPelletier opened 1 year ago
The bridgecrewio fork does not have this bug; perhaps this repo has been abandoned.
This doesn't appear to be a bug to me. $..*[?(@.thing_type)]
refers to any element of an array which contains an object with the property thing_type
. In the case of the example data, thing_type
is a nested property.
The path $..*[?(@..thing_type)]
(note the extra dot) correctly returns a match.
I want to find "Things" that descend from my parent structure regardless of where they are. "Things" are characterized by containing a
thing_type
field. To accomplish this, I use the JSONPath$..*[?(@.thing_type)]
. jsonpath.com confirms that this works with the sample data below (one match found, as expected):However, jsonpath-ng 1.5.3 fails to find this match:
The above code prints
0
instead of the expected1
.