I'm trying to suppress all the exceptions when evaluating a JSON path. but when I upgrade the JSON path lib to 2.7, it seems like it is not working as expected. For example:
var node = objectMapper.readTree("{\"test\" : null}");
JsonPath.using(Configuration.builder()
.options(Option.SUPPRESS_EXCEPTIONS).build())
.parse(node.toString())
.read("$.test[?(@ != null)]");
we got an exception thrown.
Filter: [?] can not be applied to primitives. Current context is: null
com.jayway.jsonpath.InvalidPathException: Filter: [?] can not be applied to primitives. Current context is: null
related issue : https://github.com/json-path/JsonPath/issues/908