Dot notation with number on object
Setup
Selector: $.2
{"a": "first", "2": "second", "b": "third"}
Results
Consensus
[
"second"
]
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).
"second"
Other responses
Elixir (ExJsonPath)
[]
Erlang (ejsonpath)
Not supported
syntax error before: 2
Not supported
parsing error: $.2 :1:2 - 1:4 unexpected Float while scanning operator
JavaScript (brunerd)
Not supported
Java (com.github.jsurfer)
[]
Python (jsonpath-ng)
Not supported
JsonPathParserError('Parse error at 1:2 near token 2 (NUMBER)')
Python (jsonpath-rw)
Not supported
Exception('Parse error at 1:2 near token 2 (NUMBER)')
Python (jsonpath2)
Not supported
line 1:2 mismatched input '2' expecting {'*', ID}
ValueError("line 1:2 mismatched input '2' expecting {'*', ID}")
Raku (JSON-Path)
Not supported
JSON path parse error at position 1
dotNET (JsonPath.Net)
Not supported
Could not find any valid selectors.
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.