Open cburgmer opened 4 years ago
The following queries provide results that do not match those of other implementations of JSONPath (compare https://cburgmer.github.io/json-path-comparison/):
[ ] $.2 Input:
$.2
{"a": "first", "2": "second", "b": "third"}
Expected output:
["second"]
Error:
parsing error: $.2 :1:2 - 1:4 unexpected Float while scanning operator
[ ] $[-1] Input:
$[-1]
["first", "second", "third"]
["third"]
index -1 out of bounds
[ ] $[?(@.key=='value')] Input:
$[?(@.key=='value')]
[{"key": "some"}, {"key": "value"}]
[{"key": "value"}]
parsing error: $[?(@.key=='value')] :1:12 - 1:19 could not parse string: invalid syntax
[ ] $[?(@.key)] Input:
$[?(@.key)]
[{"some": "some value"}, {"key": "value"}]
Actual output:
[]
[ ] $['key'] Input:
$['key']
{"key": "value"}
["value"]
parsing error: $['key'] :1:3 - 1:8 could not parse string: invalid syntax
[ ] $['one','three'].key Input:
$['one','three'].key
{"one": {"key": "value"}, "two": {"k": "v"}, "three": {"some": "more", "key": "other value"}}
["value", "other value"]
parsing error: $['one','three'].key :1:3 - 1:8 could not parse string: invalid syntax
[ ] $['two.some'] Input:
$['two.some']
{"one": {"key": "value"}, "two": {"some": "more", "key": "other value"}, "two.some": "42"}
["42"]
parsing error: $['two.some'] :1:3 - 1:13 could not parse string: invalid syntax
[ ] $['special:"chars'] Input:
$['special:"chars']
{"special:\"chars": "value"}
parsing error: $['special:"chars'] :1:3 - 1:19 could not parse string: invalid syntax
For reference, the output was generated by the program in https://github.com/cburgmer/json-path-comparison/tree/master/implementations/Golang_github.com-PaesslerAG-jsonpath.
The following queries provide results that do not match those of other implementations of JSONPath (compare https://cburgmer.github.io/json-path-comparison/):
[ ]
$.2
Input:Expected output:
Error:
[ ]
$[-1]
Input:Expected output:
Error:
[ ]
$[?(@.key=='value')]
Input:Expected output:
Error:
[ ]
$[?(@.key)]
Input:Expected output:
Actual output:
[ ]
$['key']
Input:Expected output:
Error:
[ ]
$['one','three'].key
Input:Expected output:
Error:
[ ]
$['two.some']
Input:Expected output:
Error:
[ ]
$['special:"chars']
Input:Expected output:
Error:
For reference, the output was generated by the program in https://github.com/cburgmer/json-path-comparison/tree/master/implementations/Golang_github.com-PaesslerAG-jsonpath.