Array slice with large number for end and negative step
Setup
Selector: $[2:-113667776004:-1]
["first", "second", "third", "forth", "fifth"]
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
[]
Clojure (json-path)
¹
"third"
Cpp (jsoncons)
[
"third",
"second",
"first"
]
Dart (json_path)
[
"third",
"second",
"first"
]
Elixir (jaxon)
[]
Elixir (warpath)
¹
[
"second",
"first"
]
Erlang (ejsonpath)
Not supported
syntax error before: '-'
[]
[
"third",
"second",
"first"
]
[
"third",
"second",
"first"
]
[
"third",
"second",
"first"
]
[
"third",
"second",
"first"
]
Haskell (jsonpath)
[
"third",
"second",
"first"
]
JavaScript (Goessner)
²
Not found
jsonpath returned false, this might indicate an error
JavaScript (brunerd)
[
"third",
"second",
"first"
]
JavaScript (jsonpath)
[
"third",
"second",
"first"
]
JavaScript (jsonpath-plus)
[]
JavaScript (jsonpathly)
[]
Java (com.github.jsurfer)
Not supported
org.antlr.v4.runtime.misc.ParseCancellationException
Java (com.jayway.jsonpath)
¹
³
Not supported
SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
com.jayway.jsonpath.InvalidPathException: java.lang.NumberFormatException: For input string: "-113667776004"
Kotlin (com.nfeld.jsonpathkt)
¹
Not supported
For input string: "-113667776004"
Objective-C (SMJJSONPath)
¹
³
[]
PHP (Goessner)
²
Not found
jsonpath returned false, this might indicate an error
PHP (galbar-jsonpath)
[
"third",
"second",
"first"
]
PHP (remorhaz-jsonpath)
[
"third",
"second",
"first"
]
PHP (softcreatr-jsonpath)
[]
Perl (JSON-Path)
[]
Python (jsonpath)
²
[
"third",
"second"
]
Python (jsonpath-ng)
Not supported
JsonPathParserError('Parse error at 1:17 near token : (:)')
Python (jsonpath-rw)
Not supported
Exception('Parse error at 1:17 near token : (:)')
Python (python-jsonpath)
[
"third",
"second",
"first"
]
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:
$[2:-113667776004:-1]
^^^^^^^^^^^^^^^^^^
Rust (jsonpath_plus)
[]
Rust (serde_json_path)
[
"third",
"second",
"first"
]
Swift (Sextant)
[]
dotNET (JsonCons.JsonPath)
[
"third",
"second",
"first"
]
dotNET (JsonPath.Net)
[
"third",
"second",
"first"
]
dotNET (JsonPathLib)
[]
dotNET (Manatee.Json)
Not supported
Expected number. Path up to error: '$'
Errors
Elixir (ExJsonPath)
FunctionClauseError
only support one range(from, to): [2 -113667776004 -1]
Python (jsonpath2)
timeout: sending signal TERM to command ‘implementations/Python_jsonpath2/run.sh’
Ruby (jsonpath)
step can't be negative
Scala (jsonpath)
java.lang.NumberFormatException: For input string: "-113667776004"
dotNET (Json.NET)
Value was either too large or too small for an Int32.
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.