Bracket notation with two literals separated by dot without quotes
Setup
Selector: $[two.some]
{
"one": {"key": "value"},
"two": {"some": "more", "key": "other value"},
"two.some": "42"
}
Results
Consensus
Not supported
Other responses
Bash (JSONPath.sh)
[
"more"
]
Elixir (jaxon)
[
"42"
]
[
"42"
]
JavaScript (Goessner)
²
[
"more"
]
JavaScript (jsonpath-plus)
[
"42"
]
PHP (Goessner)
²
[
"more"
]
Perl (JSON-Path)
[]
Python (jsonpath)
²
[
"more"
]
dotNET (JsonPathLib)
[
"more"
]
Errors
Clojure (json-path)
¹
java.lang.Exception object must be an array.
unknown key more
path: invalid character at 5
strconv.Atoi: parsing "two.some": invalid syntax
Ruby (jsonpath)
invalid value for Integer(): "two.some"
Rust (jsonpath_plus)
Error Parsing JSON Path:
$[two.some]
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.