{"store": {"book": [{"category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95}, {"category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99}, {"category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "isbn": "0-553-21311-3", "price": 8.99}, {"category": "fiction", "author": "J. R. R. Tolkien", "title": "The Lord of the Rings", "isbn": "0-395-19395-8", "price": 22.99}], "bicycle": {"color": "red", "price": 19.95}}}
[8.95, 12.99, 8.99, 22.99, 19.95]
{"bicycle": {"price": 19.95}, "book": [{"price": 8.95}, {"price": 12.99}, {"price": 8.99}, {"price": 22.99}]}
The following queries provide results that do not match those of other implementations of JSONPath
(compare https://cburgmer.github.io/json-path-comparison/):
$[1:10]Input:
Expected output:
Error:
$[-1:]Input:
Expected output:
Actual output:
$[1:]Input:
Expected output:
Error:
$[0:3:2]Input:
Expected output:
Actual output:
$[0:3:1]Input:
Expected output:
Actual output:
$['key']Input:
Expected output:
Actual output:
$['key','another']Input:
Expected output:
Actual output:
$['0']Input:
Expected output:
Error:
$['special:"chars']Input:
Expected output:
Error:
$['*']Input:
Expected output:
Actual output:
$.keyInput:
Expected output:
Actual output:
$.keyInput:
Expected output:
Actual output:
$.keyInput:
Expected output:
Actual output:
$..keyInput:
Expected output:
Actual output:
$.store..priceInput:
Expected output:
Actual output:
$Input:
Expected output:
Error:
$[*]Input:
Expected output:
Error:
$[*]Input:
Expected output:
Actual output:
$.*Input:
Expected output:
Error:
$.*Input:
Expected output:
Actual output:
For reference, the output was generated by the program in https://github.com/cburgmer/json-path-comparison/tree/Bash_JSONPath.sh/implementations/Bash_JSONPath.sh.