Bracket notation with quoted wildcard literal
Setup
Selector: $['*']
{
"*": "value",
"another": "entry"
}
Results
Consensus
[
"value"
]
Scalar consensus
The scalar consensus applies for implementations which return a single value where only one match is possible (instead of an array of a single value).
"value"
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
[
"entry",
"value"
]
Clojure (json-path)
¹
[
"entry",
"value"
]
Elixir (jaxon)
[]
JavaScript (jsonpath-plus)
[
"entry",
"value"
]
Perl (JSON-Path)
[
"entry",
"value"
]
Python (jsonpath-ng)
[
"entry",
"value"
]
Python (jsonpath-rw)
[
"entry",
"value"
]
Python (jsonpath2)
Not supported
line 1:2 token recognition error at: '''
ValueError("line 1:2 token recognition error at: '''")
Rust (jsonpath)
Not supported
parsing error
Scala (jsonpath)
[
"entry",
"value"
]
Errors
strconv.Atoi: parsing "'*'": invalid syntax
Python (jsonpath)
²
RecursionError('maximum recursion depth exceeded while calling a Python object')
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.