Open juanreynolds opened 1 year ago
We have also encountered this bug. In our schema, many values are optional and it never caused a problem with the jsonpath library. However, when using jsonpath-plus, it returns nothing if any item in the array has undefined in the chain (e.g. ".text" is undefined in one object). It would be great if this library could ignore undefined paths and still return the matches.
Just tested again and the problem persists in v8.0.0. The problem only raises its head when working with array notation.
Version 7.2.0 (and earlier)
This code:
gives error: Error: jsonPath: Cannot read property 'type' of null: @.type=="b"
BUT when the 2nd item in the array has a text property that is not undefined or null it works as expected:
THIS WORKS:
AND when the path is not in array notation but in string notation it works:
THIS WORKS: