Closed enridaga closed 1 year ago
Thanks so much for reporting. I'll examine the code to see if any quick fix on this.
@enridaga the first working implementation just submitted. Please feel free to pull the source and test
Works as expected now -- we may do more tests later but in the meantime this looks very good -- look forward to the release!
Any plan for the next release?
Any plan for the next release?
Merged in master
published
This is related to comparison test case https://cburgmer.github.io/json-path-comparison/results/filter_expression_after_recursive_descent.html#Java_com.github.jsurfer
Consider the following JSON:
and the following Java snippet:
I get the following behaviour with the path expressions
Expression:
$..[?(@.letter == 'X')]
(does not work as expected)I would have expected instead, matches of the inner JsonObjects only:
Changing the expression to matching one object in the first 'layer' works as expected.
Expression
$..[?(@.letter == 'A')]
(works as expected)Expression
$..[?(@.number == 1.2)]
(does not work as expected)I think the problem is indeed the fact that the match is including the containing object, but it should not (at least, from my understanding of JsonPath). The behaviour I would have expected is the one of Jayway, I tried with https://jsonpath.herokuapp.com . However, I want to stick to JsonSurfer for the streaming capabilities.
For reference, the case is implemented as a test here and relates to this feature issue