Array slice with step 0

Setup

Selector: $[0:3:0]

["first", "second", "third", "forth", "fifth"]

Results

Other responses

Bash (JSONPath.sh)

[
  "first",
  "second",
  "third"
]

Clojure (json-path) ¹

"first"

Cpp (jsoncons)

Not supported

Slice step cannot be zero at line 1 and column 8

Dart (json_path)

[]

Elixir (ExJsonPath)

[]

Elixir (jaxon)

[]

Elixir (warpath) ¹

[]

Erlang (ejsonpath)

[]

Golang (github.com-AsaiYusuke-jsonpath) ²

Not found

member did not exist (path=[0:3:0])

Golang (github.com-PaesslerAG-jsonpath) ¹

[
  "first",
  "second",
  "third"
]

Golang (github.com-bhmj-jsonslice) ¹ ³

[
  "first",
  "second",
  "third"
]

Golang (github.com-ohler55-ojg)

[]

Golang (github.com-vmware-labs-yaml-jsonpath)

Not supported

invalid array index [0:3:0] before position 8: array index step value must be non-zero

Haskell (jsonpath)

[]

JavaScript (jsonpath-plus)

[
  "first",
  "second",
  "third"
]

Java (com.github.jsurfer)

Not supported

org.antlr.v4.runtime.misc.ParseCancellationException

Java (com.jayway.jsonpath) ¹ ³

[
  "first",
  "second",
  "third"
]

Kotlin (com.nfeld.jsonpathkt) ¹

[
  "first",
  "second",
  "third"
]

Objective-C (SMJJSONPath) ¹ ³

[
  "first",
  "second",
  "third"
]

PHP (Goessner) ²

[
  "first",
  "second",
  "third"
]

PHP (remorhaz-jsonpath)

[]

PHP (softcreatr-jsonpath)

[
  "first",
  "second",
  "third"
]

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 : (:)')

Raku (JSON-Path)

Not supported

JSON path parse error at position 1

Rust (jsonpath)

Not supported

parsing error

Swift (Sextant)

[
  "first",
  "second",
  "third"
]

dotNET (Json.NET)

Not supported

Step cannot be zero.

dotNET (JsonCons.JsonPath)

Not supported

Slice step cannot be zero

dotNET (JsonPath.Net)

[]

dotNET (Manatee.Json)

[]

JSON (Path_Reference_Implementation)

[]

Proposal (A)

Not supported


x 1:7-1:7 NonZeroInteger
| $[0:3:0]
|       ^
o 1:3-1:7 BracketElement
| $[0:3:0]
|   ^^^^
o 1:3-1:7 BracketElements
| $[0:3:0]
|   ^^^^
x 1:2-1:2 BracketChildren
| $[0:3:0]
|  ^
x 1:2-1:2 Operator
| $[0:3:0]
|  ^
o 1:1-1:2 Start
  $[0:3:0]
  ^

Errors

C (json-glib)

timeout: sending signal TERM to command ‘build/main’

Golang (github.com-oliveagle-jsonpath) ¹

only support one range(from, to): [0 3 0]

Golang (github.com-spyzhov-ajson)

wrong request: wrong request: 0:3:0

JavaScript (Goessner) ²

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

JavaScript (brunerd)

Slice step cannot be zero: [0:3:0]

JavaScript (jsonpath)

step cannot be zero

PHP (galbar-jsonpath) ²

Error: 'Step cannot be 0'

Perl (JSON-Path)

Illegal modulus zero at build/lib/perl5/JSON/Path/Evaluator.pm line 412, <STDIN> line 1.

Python (jsonpath) ²

ValueError('range() arg 3 must not be zero')

Python (jsonpath2)

ValueError('range() arg 3 must not be zero')

Ruby (jsonpath)

step can't be 0

Rust (jsonpath_lib)

panic occurred

Rust (jsonpath_plus)

Error Parsing JSON Path:
$[0:3:0]
panic occurred

Scala (jsonpath)

java.lang.IllegalArgumentException: requirement failed: size=0 and step=0, but both must be positive

dotNET (JsonPathLib)

timeout: sending signal TERM to command ‘build/Dotnet_JsonPathLib’

Footnotes