Dot bracket notation without quotes
Setup
Selector: $.[key]
{
"key": "value",
"other": {"key": [{"key": 42}]}
}
Results
Consensus
Not supported
Other responses
Bash (JSONPath.sh)
[
"value"
]
Elixir (jaxon)
[
"value"
]
"value"
[
"value"
]
JavaScript (Goessner)
²
[
"value",
[
{
"key": 42
}
],
42
]
JavaScript (jsonpath-plus)
[
"value",
[
{
"key": 42
}
],
42
]
PHP (Goessner)
²
[
"value",
[
{
"key": 42
}
],
42
]
PHP (remorhaz-jsonpath)
[
"value"
]
PHP (softcreatr-jsonpath)
[
"value"
]
Perl (JSON-Path)
[
"value"
]
Python (jsonpath)
²
[
"value",
[
{
"key": 42
}
],
42
]
Python (jsonpath-ng)
[
"value"
]
Python (jsonpath-rw)
[
"value"
]
Python (python-jsonpath)
[
"value"
]
dotNET (JsonPathLib)
[
"value",
[
{
"key": 42
}
],
42
]
Errors
Clojure (json-path)
¹
java.lang.Exception object must be an array.
strconv.Atoi: parsing "key": invalid syntax
Ruby (jsonpath)
invalid value for Integer(): "key"
Rust (jsonpath_plus)
Error Parsing JSON Path:
$.[key]
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.