Bracket notation with wildcard after array slice
Setup
Selector: $[0:2][*]
[[1, 2], ["a", "b"], [0, 0]]
Results
Consensus
[
1,
2,
"a",
"b"
]
Other responses
Clojure (json-path)
¹
[
1,
2
]
Elixir (ExJsonPath)
Not supported
syntax error before: '*'
Elixir (jaxon)
[]
[
[
1,
2
],
[
"a",
"b"
]
]
[
[
1,
2
],
[
"a",
"b"
],
[
0,
0
]
]
Raku (JSON-Path)
[
1,
2,
"a",
"b",
0,
0
]
Rust (jsonpath)
Not supported
parsing error
JSON (Path_Reference_Implementation)
Not supported
--> 1:8
|
1 | $[0:2][*]
| ^---
|
= expected unionChild, unionArrayIndex, or sliceStart
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.