What steps will reproduce the problem?
1. {"']['" : "bar"} with $..*.
What is the expected output? What do you see instead?
It produces $['']['']. I would expect something like produces $['\'][\''], so
the ' escaped.
What version of the product are you using? On what operating system?
1.3.0 SNAPSHOT (07a515245135e3bc7d8d63054f856a7ee9032dee)
Example test cases:
Configuration conf = Configuration.builder().options(AS_PATH_LIST).build();
List<String> pathList = using(conf).parse("{\"']['\" : \"bar\"}").read("$..*");
assertThat(pathList).containsOnly("$['\\'][\\'']");
For handling escaped jsonpaths:
//This should work only if assuming no escaping is necessary
// Configuration conf = Configuration.builder().build();
// assertThat(using(conf).parse("{\"']['\" :
\"bar\"}").read("$['']['']")).isEqualTo("bar");
//This should work assuming escaping is unevitable and the escaping character
is \:
Configuration conf = Configuration.builder().build();
assertThat(using(conf).parse("{\"']['\" : \"bar\"}").read("$['\\'][\\'']")).isEqualTo("bar");
Probably the backslash character has to be escaped in the paths too, so
{"\\" : "bar"} with $..* should return normalized path $['\\'] (which is
currently works as expected) and $['\\'] query should return "bar" (but only
$['\'] returns bar), but it results in no results.
Original issue reported on code.google.com by bakos.ga...@mind-era.com on 8 Mar 2015 at 7:28
Original issue reported on code.google.com by
bakos.ga...@mind-era.com
on 8 Mar 2015 at 7:28