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)
[]
Not found
member did not exist (path=[0:3:0])
[
"first",
"second",
"third"
]
[
"first",
"second",
"third"
]
[]
Not supported
invalid array index [0:3:0] before position 8: array index step value must be non-zero
Haskell (jsonpath)
[]
JavaScript (json-p3)
[]
JavaScript (jsonpath-plus)
[
"first",
"second",
"third"
]
JavaScript (jsonpathly)
[
"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-rw)
Not supported
Exception('Parse error at 1:5 near token : (:)')
Python (python-jsonpath)
[]
Raku (JSON-Path)
Not supported
JSON path parse error at position 1
Rust (jsonpath)
Not supported
parsing error
Rust (serde_json_path)
[]
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)
[]
Errors
C (json-glib)
timeout: sending signal TERM to command ‘build/main’
only support one range(from, to): [0 3 0]
wrong request: wrong request: 0:3:0
JavaScript (Goessner)
²
<--- Last few GCs --->
[115332:0x55d2125e6590] 1563 ms: Mark-sweep 24.5 (41.4) -> 8.7 (41.4) MB, 18.6 / 0.0 ms (average mu = 0.810, current mu = 0.858) allocation failure; scavenge might not succeed
[115332:0x55d2125e6590] 1676 ms: Mark-sweep 34.4 (51.4) -> 12.1 (44.7) MB, 26.2 / 0.0 ms (average mu = 0.788, current mu = 0.768) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0x7f3d3034833c node::Abort() [/lib/x86_64-linux-gnu/libnode.so.109]
2: 0x7f3d3023c5db [/lib/x86_64-linux-gnu/libnode.so.109]
3: 0x7f3d3072e544 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/lib/x86_64-linux-gnu/libnode.so.109]
4: 0x7f3d3072e938 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/lib/x86_64-linux-gnu/libnode.so.109]
5: 0x7f3d3091a0e9 [/lib/x86_64-linux-gnu/libnode.so.109]
6: 0x7f3d3092fc69 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/lib/x86_64-linux-gnu/libnode.so.109]
7: 0x7f3d3090ac5a v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/lib/x86_64-linux-gnu/libnode.so.109]
8: 0x7f3d3090bd78 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/lib/x86_64-linux-gnu/libnode.so.109]
9: 0x7f3d308eb0ff v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/lib/x86_64-linux-gnu/libnode.so.109]
10: 0x7f3d308e1543 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithHoles(int, v8::internal::AllocationType) [/lib/x86_64-linux-gnu/libnode.so.109]
11: 0x7f3d308f7165 v8::internal::Factory::NewJSArrayStorage(v8::internal::ElementsKind, int, v8::internal::ArrayStorageAllocationMode) [/lib/x86_64-linux-gnu/libnode.so.109]
12: 0x7f3d308f7206 v8::internal::Factory::NewJSArray(v8::internal::ElementsKind, int, int, v8::internal::ArrayStorageAllocationMode, v8::internal::AllocationType) [/lib/x86_64-linux-gnu/libnode.so.109]
13: 0x7f3d30cfa57d v8::internal::Runtime_StringSplit(int, unsigned long*, v8::internal::Isolate*) [/lib/x86_64-linux-gnu/libnode.so.109]
14: 0x7f3d3063e1f9 [/lib/x86_64-linux-gnu/libnode.so.109]
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 (jsonpath-ng)
ValueError('slice step cannot 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
- ¹ 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.