jsonpath-rs
jsonpath-rs copied to clipboard
Results do not match other implementations
The following queries provide results that do not match those of other implementations of JSONPath (compare https://cburgmer.github.io/json-path-comparison/):
-
[ ]
$[-1:]
Input:["first", "second", "third"]
Expected output:
["third"]
Error:
parsing error
-
[ ]
$[:]
Input:["first", "second"]
Expected output:
["first", "second"]
Error:
parsing error
-
[ ]
$[1:3]
Input:["first", "second", "third", "forth", "fifth"]
Expected output:
["second", "third"]
Actual output:
["second", "third", "forth"]
-
[ ]
$[0:1]
Input:["first", "second"]
Expected output:
["first"]
Actual output:
["first", "second"]
-
[ ]
$[?(@.key)]
Input:[{"some": "some value"}, {"key": "value"}]
Expected output:
[{"key": "value"}]
Error:
parsing error
-
[ ]
$.*
Input:{"some": "string", "int": 42, "object": {"key": "value"}, "array": [0, 1]}
Expected output:
["string", 42, {"key": "value"}, [0, 1]]
Actual output:
[[0, 1], 42, {"key": "value"}, "string"]
For reference, the output was generated by the program in https://github.com/cburgmer/json-path-comparison/tree/master/implementations/Rust_jsonpath.
Hope this helps. There is more in the comparison, but you explicitly called out that not all features are currently supported, so I removed failing comparisons connected to those.