Array slice with negative step on partially overlapping array
Setup
Selector: $[7:3:-1]
["first", "second", "third", "forth", "fifth"]
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
[]
Cpp (jsoncons)
[
"fifth"
]
Dart (json_path)
[
"fifth"
]
Elixir (jaxon)
[]
Elixir (warpath)
¹
[
"fifth",
"forth"
]
Erlang (ejsonpath)
Not supported
syntax error before: '-'
[]
[
"fifth"
]
[]
[
"fifth"
]
[
"fifth"
]
Haskell (jsonpath)
[
"fifth"
]
JavaScript (Goessner)
²
Not found
jsonpath returned false, this might indicate an error
JavaScript (brunerd)
[
"fifth"
]
JavaScript (jsonpath-plus)
[]
JavaScript (jsonpathly)
[]
Java (com.github.jsurfer)
Not supported
org.antlr.v4.runtime.misc.ParseCancellationException
Java (com.jayway.jsonpath)
¹
³
[]
Kotlin (com.nfeld.jsonpathkt)
¹
[]
Objective-C (SMJJSONPath)
¹
³
[]
PHP (Goessner)
²
Not found
jsonpath returned false, this might indicate an error
PHP (galbar-jsonpath)
[
"fifth"
]
PHP (remorhaz-jsonpath)
[
"fifth"
]
PHP (softcreatr-jsonpath)
[]
Perl (JSON-Path)
[]
Python (jsonpath)
²
[
"fifth"
]
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)
[
"fifth"
]
Python (python-jsonpath)
[
"fifth"
]
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:
$[7:3:-1]
^^^^^^
Rust (jsonpath_plus)
[]
Rust (serde_json_path)
[
"fifth"
]
Scala (jsonpath)
[
"fifth"
]
Swift (Sextant)
[]
dotNET (Json.NET)
[
"fifth"
]
dotNET (JsonCons.JsonPath)
[
"fifth"
]
dotNET (JsonPath.Net)
[
"fifth"
]
dotNET (JsonPathLib)
[]
Errors
Clojure (json-path)
¹
java.lang.IndexOutOfBoundsException nil
Elixir (ExJsonPath)
FunctionClauseError
only support one range(from, to): [7 3 -1]
JavaScript (jsonpath)
Cannot read property 'value' of undefined
Ruby (jsonpath)
step can't be negative
dotNET (Manatee.Json)
Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
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.