Closed GoogleCodeExporter closed 8 years ago
Thank you Matt Bishop for the contribution of tests.
Original comment by kalle.st...@gmail.com
on 28 Feb 2012 at 1:06
Original comment by kalle.st...@gmail.com
on 28 Feb 2012 at 1:09
Sorry Kalle, this is not fixed. I got confused in writing the test. The code I
pushed adds a test for directly finding an attribute with a dash in the
property name. This bug report addresses using a filter "@" to find a property
with a dash in it. This still does not work in v56.
I am going to spend a bit of time looking at this specific issue on your new
codebase to see if I can find and fix it as it is critical in our use of
json-path.
Congratulations on your redesign! I like the SPI approach.
Original comment by m...@thebishops.org
on 28 Feb 2012 at 3:02
I tracked down the bug, it's in PathTokenizer.splitPath(). When you have an
expression like:
[?(@['display-price'] < 10)]
The splitPath method identifies the first '[' and then calls extract(']') to
find the whole expression. The problem is, the whole expression includes a
second, array reference, so the Tokenizer breaks it into two fragments:
[?(@['display-price']
and
< 10)]
The solution is to not split on the first ']' but on the second one. This means
extract has to be smarter and count '[' chars along the way to find the final
']'.
Interestingly this breaks for other filters with arrays like
$.store.book[?(@['isbn'])].isbn but the Filters clean this up with their call
to trim(5, 2).
Original comment by m...@thebishops.org
on 28 Feb 2012 at 9:13
Original issue reported on code.google.com by
m...@thebishops.org
on 13 Dec 2011 at 11:59