Dot notation with dash

Setup

Selector: $.key-dash

{
  "key": 42,
  "key-": 43,
  "-": 44,
  "dash": 45,
  "-dash": 46,
  "": 47,
  "key-dash": "value",
  "something": "else"
}

Results

Consensus

[
  "value"
]

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).

"value"

Other responses

Cpp (jsoncons)

Not supported

Expected '$' or function expression at line 1 and column 6

Dart (json_path)

Not supported

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

Elixir (ExJsonPath)

Not supported

illegal characters "-d"

Erlang (ejsonpath)

Not supported

syntax error before: '-'

Golang (github.com-PaesslerAG-jsonpath) ¹

Not supported

parsing error: $.key-dash	:1:6 - 1:7 unexpected "-" while scanning operator

Golang (github.com-bhmj-jsonslice) ¹ ³

42

Golang (github.com-ohler55-ojg)

Not supported

Golang (github.com-theory-jsonpath)

Not supported

jsonpath: invalid number literal at position 6

JavaScript (brunerd)

Not supported

JavaScript (jsonpath)

Not supported

Lexical error on line 1. Unrecognized text.
$.key-dash
-----^

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>6</column><pos>6</pos><unexpected>-</unexpected><permitted>#9, #A, #D, ' ', '.', '[', '_', [#80-'퟿[xd7ff]'], ['0'-'9'], ['A'-'Z'; 'a'-'z'], ['𐀀[x10000]'-'􏿯[x10ffef]'], ['[xe000]'-'￯[xffef]']</permitted><completions><completed rule="member-name-shorthand" start="3" end="5"><input>key</input></completed><completed rule="child-segment" start="2" end="5"><input>.key</input></completed><completed rule="segment" start="2" end="5"><input>.key</input></completed><completed rule="segments" start="2" end="5"><input>.key</input></completed></completions><could-be-next><in rule="bracketed-selection"><tokens>'['</tokens></in><in rule="ALPHA"><tokens>['A'-'Z'; 'a'-'z']</tokens></in><in rule="DIGIT"><tokens>['0'-'9']</tokens></in><in rule="descendant-segment"><tokens>'.'</tokens></in><in rule="B"><tokens>#9, #A, #D, ' '</tokens></in><in rule="child-segment"><tokens>'.'</tokens></in><in rule="name-first"><tokens>'_', [#80-'퟿[xd7ff]'], ['𐀀[x10000]'-'􏿯[x10ffef]'], ['[xe000]'-'￯[xffef]']</tokens></in></could-be-next></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>6</column><pos>6</pos><unexpected>-</unexpected><permitted>#9, #A, #D, ' ', '.', '[', '_', [#80-'퟿'], ['0'-'9'], ['A'-'Z'; 'a'-'z'], ['𐀀'-'􏿯'], [''-'￯']</permitted><completions><completed rule="member-name-shorthand" start="3" end="5"><input>key</input></completed><completed rule="child-segment" start="2" end="5"><input>.key</input></completed><completed rule="segment" start="2" end="5"><input>.key</input></completed><completed rule="segments" start="2" end="5"><input>.key</input></completed></completions><could-be-next><in rule="bracketed-selection"><tokens>'['</tokens></in><in rule="ALPHA"><tokens>['A'-'Z'; 'a'-'z']</tokens></in><in rule="DIGIT"><tokens>['0'-'9']</tokens></in><in rule="descendant-segment"><tokens>'.'</tokens></in><in rule="B"><tokens>#9, #A, #D, ' '</tokens></in><in rule="child-segment"><tokens>'.'</tokens></in><in rule="name-first"><tokens>'_', [#80-'퟿'], ['𐀀'-'􏿯'], [''-'￯']</tokens></in></could-be-next></failed>

Python (jsonpath2)

Not supported

line 1:5 token recognition error at: '-d'
ValueError("line 1:5 token recognition error at: '-d'")

Raku (JSON-Path)

Not supported

JSON path parse error at position 5

Rust (serde_json_path)

Not supported

at position 5, parser error

dotNET (JsonCons.JsonPath)

Not supported

Expected '.' or '[' or '^'

dotNET (JsonPath.Net)

Not supported

Could not find any valid selectors.

dotNET (Manatee.Json)

Not supported

Unrecognized JSON Path element. Path up to error: '$.key'

Footnotes