Union with wildcard and number
Setup
Selector: $[*,1]
["first", "second", "third", "forth", "fifth"]
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
Not supported
Unable to compile selector `$[*,1]': Invalid array index definition “*,1]”
Clojure (json-path)
¹
[
"first",
"second",
"third",
"forth",
"fifth"
]
Cpp (jsoncons)
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
Dart (json_path)
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
Elixir (ExJsonPath)
Not supported
syntax error before: '*'
Elixir (jaxon)
[]
Elixir (warpath)
¹
Not supported
Parser error: Invalid token on line 1, syntax error before: <<",">>
Erlang (ejsonpath)
Not supported
syntax error before: ','
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
Not supported
parsing error: $[*,1] :1:4 - 1:5 unexpected "," while scanning JSON bracket star expected "]"
[
"second"
]
Not supported
[
"second"
]
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
Haskell (jsonpath)
Not supported
Invalid JSONPath: $[*,1]
Error: 1:4:
|
1 | $[*,1]
| ^
unexpected ','
expecting ']' or white space
JavaScript (Goessner)
²
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
JavaScript (brunerd)
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
JavaScript (json-p3)
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
JavaScript (jsonpath)
Not supported
Parse error on line 1:
$[*,1]
---^
Expecting ']', got ','
JavaScript (jsonpath-plus)
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
JavaScript (jsonpathly)
Not supported
mismatched input ',' expecting ']'
Java (com.github.jsurfer)
Not supported
line 1:2 no viable alternative at input '[*'
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: Expected wildcard token to end with ']' on position 3
Kotlin (com.nfeld.jsonpathkt)
¹
Not supported
Unexpected char, char=*, index=2
Objective-C (SMJJSONPath)
¹
³
Not supported
Expected wildcard token to end with ']' on position 3
PHP (Goessner)
²
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
PHP (galbar-jsonpath)
Not supported
Invalid JSONPath error: 'Error in JSONPath near '*,1''
PHP (remorhaz-jsonpath)
Not supported
Error: 'Failed to build AST from JSONPath query: $[*,1]'
PHP (softcreatr-jsonpath)
Not supported
Error: 'Unable to parse token *,1 in expression: [*,1]'
Perl (JSON-Path)
[
"second"
]
Python (jsonpath)
²
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
Python (jsonpath-ng)
Not supported
JsonPathParserError('Parse error at 1:3 near token , (,)')
Python (jsonpath-rw)
Not supported
Exception('Parse error at 1:3 near token , (,)')
Python (jsonpath2)
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
Python (python-jsonpath)
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
Raku (JSON-Path)
Not supported
JSON path parse error at position 1
Ruby (jsonpath)
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
Rust (jsonpath)
Not supported
parsing error
Rust (jsonpath_lib)
Not supported
path error:
$[*,1]
^^^^
Rust (serde_json_path)
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
Scala (jsonpath)
Not supported
JPError(end of input expected)
Swift (Sextant)
Not supported
NOT_SUPPORTED
dotNET (Json.NET)
Not supported
Unexpected character while parsing path indexer: *
dotNET (JsonCons.JsonPath)
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
dotNET (JsonPath.Net)
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
dotNET (JsonPathLib)
[
"first",
"second",
"third",
"forth",
"fifth",
"second"
]
dotNET (Manatee.Json)
Not supported
Unrecognized JSON Path element. Path up to error: '$'
Errors
strconv.Atoi: parsing "*": invalid syntax
Rust (jsonpath_plus)
Error Parsing JSON Path:
$[*,1]
panic occurred
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.