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

Golang (github.com-PaesslerAG-jsonpath) ¹

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