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

Dart (json_path)

Not supported

Instance of 'ParserException': end of input expected (at 1:2)

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

Golang (github.com-theory-jsonpath)

Not supported

jsonpath: unexpected integer at position 3

JavaScript (brunerd)

Not supported

Java (com.github.jsurfer)

[]

Java (com.github.xmljacquard.ajp)

Not supported

Error at char 18 in expression in xsl:sequence/@select on line 20 column 67 of ajp-runner.xslt:
   <failed xmlns:ixml="http://invisiblexml.org/NS"
  ixml:state="failed"><line>1</line><column>2</column><pos>3</pos><unexpected>2</unexpected><permitted>'*', '_', [#80-'퟿[xd7ff]'], ['A'-'Z'; 'a'-'z'], ['𐀀[x10000]'-'􏿯[x10ffef]'], ['[xe000]'-'￯[xffef]']</permitted><could-be-next><in rule="ALPHA"><tokens>['A'-'Z'; 'a'-'z']</tokens></in><in rule="wildcard-selector"><tokens>'*'</tokens></in><in rule="name-first"><tokens>'_', [#80-'퟿[xd7ff]'], ['𐀀[x10000]'-'􏿯[x10ffef]'], ['[xe000]'-'￯[xffef]']</tokens></in></could-be-next><unfinished><open rule="child-segment" start="2" end="2"><input>.</input></open><open rule="jsonpath-query" start="1" end="1"><input>$</input></open></unfinished></failed>
During lazy evaluation of tailCallLoop(ajp:getProcessor(...)) on line 20 of jar:file:./implementations/Java_com.github.xmljacquard.ajp/build/deps/org/xmljacquard/ajp/0.0.7/ajp-0.0.7.jar!/xslt/ajp-runner.xslt
In function ajpr:getProcessor on line 17 column 106 of ajp-runner.xslt:
net.sf.saxon.s9api.SaxonApiException: <failed xmlns:ixml="http://invisiblexml.org/NS" ixml:state="failed"><line>1</line><column>2</column><pos>3</pos><unexpected>2</unexpected><permitted>'*', '_', [#80-'퟿'], ['A'-'Z'; 'a'-'z'], ['𐀀'-'􏿯'], [''-'￯']</permitted><could-be-next><in rule="ALPHA"><tokens>['A'-'Z'; 'a'-'z']</tokens></in><in rule="wildcard-selector"><tokens>'*'</tokens></in><in rule="name-first"><tokens>'_', [#80-'퟿'], ['𐀀'-'􏿯'], [''-'￯']</tokens></in></could-be-next><unfinished><open rule="child-segment" start="2" end="2"><input>.</input></open><open rule="jsonpath-query" start="1" end="1"><input>$</input></open></unfinished></failed>

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}")

Python (python-jsonpath)

Not supported

JSONPathSyntaxError('expected a shorthand selector')

Raku (JSON-Path)

Not supported

JSON path parse error at position 1

Rust (serde_json_path)

Not supported

at position 2, in dot member name, must start with lowercase alpha or '_'

dotNET (JsonPath.Net)

Not supported

Could not find any valid selectors.

Errors

JavaScript (json-p3)

unexpected shorthand selector '2' ('$.2':2)

Footnotes