Array slice with negative step
Setup
Selector: $[3:0:-2]
["first", "second", "third", "forth", "fifth"]
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
[]
Clojure (json-path)
¹
"forth"
Cpp (jsoncons)
[
"forth",
"second"
]
Dart (json_path)
[
"forth",
"second"
]
Elixir (jaxon)
[]
Elixir (warpath)
¹
[
"third",
"first"
]
Erlang (ejsonpath)
Not supported
syntax error before: '-'
[
"forth",
"second"
]
[]
[
"forth",
"second"
]
[
"forth",
"second"
]
[
"forth",
"second"
]
[
"forth",
"second"
]
Haskell (jsonpath)
[
"forth",
"second"
]
JavaScript (Goessner)
²
Not found
jsonpath returned false, this might indicate an error
JavaScript (brunerd)
[
"forth",
"second"
]
JavaScript (jsonpath)
[
"forth",
"second"
]
JavaScript (jsonpath-plus)
[]
Java (com.github.jsurfer)
Not supported
org.antlr.v4.runtime.misc.ParseCancellationException
Java (com.jayway.jsonpath)
¹
³
[]
Kotlin (com.nfeld.jsonpathkt)
¹
[]
Objective-C (SMJJSONPath)
¹
³
[]
PHP (galbar-jsonpath)
²
[
"forth",
"second"
]
PHP (remorhaz-jsonpath)
[
"forth",
"second"
]
PHP (softcreatr-jsonpath)
[]
Perl (JSON-Path)
[]
Python (jsonpath)
²
[
"forth",
"second"
]
Python (jsonpath-ng)
Not supported
JsonPathParserError('Parse error at 1:5 near token : (:)')
Python (jsonpath-rw)
Not supported
Exception('Parse error at 1:5 near token : (:)')
Python (jsonpath2)
[
"forth",
"second"
]
Raku (JSON-Path)
Not supported
JSON path parse error at position 1
Rust (jsonpath)
Not supported
parsing error
Rust (jsonpath_lib)
Not supported
path error:
$[3:0:-2]
^^^^^^
Rust (jsonpath_plus)
[]
Scala (jsonpath)
[
"forth",
"second"
]
Swift (Sextant)
[]
dotNET (Json.NET)
[
"forth",
"second"
]
dotNET (JsonCons.JsonPath)
[
"forth",
"second"
]
dotNET (JsonPath.Net)
[
"forth",
"second"
]
dotNET (JsonPathLib)
[]
dotNET (Manatee.Json)
[
"forth",
"second"
]
JSON (Path_Reference_Implementation)
[
"forth",
"second"
]
Proposal (A)
[
"forth",
"second"
]
Errors
Elixir (ExJsonPath)
FunctionClauseError
only support one range(from, to): [3 0 -2]
PHP (Goessner)
²
timeout: sending signal TERM to command ‘implementations/PHP_Goessner/run.sh’
Ruby (jsonpath)
step can't be negative
Footnotes
- ¹ This implementation returns a single value where only one match is possible (instead of an array of a single value).
- ² This implementation returns a specific not found value if no match exists.
- ³ This implementation returns a specific not found value if a query that would regularly return a single match results in no match.