Dot notation with number
Setup
Selector: $.2
["first", "second", "third", "forth", "fifth"]
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
[]
Clojure (json-path)
¹
null
Cpp (jsoncons)
[
"third"
]
Dart (json_path)
Not supported
Instance of 'ParserException': end of input expected (at 1:2)
Elixir (ExJsonPath)
[
"third"
]
Elixir (jaxon)
[]
Elixir (warpath)
¹
null
Erlang (ejsonpath)
Not supported
syntax error before: 2
Not supported
parsing error: $.2 :1:2 - 1:4 unexpected Float while scanning operator
"third"
[]
[]
[
"third"
]
Not supported
jsonpath: unexpected integer at position 3
[]
Haskell (jsonpath)
[]
JavaScript (Goessner)
²
[
"third"
]
JavaScript (brunerd)
Not supported
JavaScript (jsonpath)
[
"third"
]
JavaScript (jsonpath-plus)
[
"third"
]
JavaScript (jsonpathly)
[
"third"
]
Java (com.github.jsurfer)
[
"third"
]
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>
Java (com.jayway.jsonpath)
¹
³
Not found
SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
com.jayway.jsonpath.PathNotFoundException: Expected to find an object with property ['2'] in path $ but found 'net.minidev.json.JSONArray'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.
Kotlin (com.nfeld.jsonpathkt)
¹
null
Objective-C (SMJJSONPath)
¹
³
Not found
Expected to find an object with property ['2'] in path $ but found 'GSArray'. This is not a json object.
PHP (Goessner)
²
[
"third"
]
PHP (galbar-jsonpath)
[
"third"
]
PHP (remorhaz-jsonpath)
[]
PHP (softcreatr-jsonpath)
[
"third"
]
Perl (JSON-Path)
[
"third"
]
Python (jsonpath)
²
[
"third"
]
Python (jsonpath-ng)
[]
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
Ruby (jsonpath)
[]
Rust (jsonpath)
[]
Rust (jsonpath_lib)
[]
Rust (jsonpath_plus)
[]
Rust (serde_json_path)
Not supported
at position 2, in dot member name, must start with lowercase alpha or '_'
Scala (jsonpath)
[]
Swift (Sextant)
[]
dotNET (Json.NET)
[]
dotNET (JsonCons.JsonPath)
[]
dotNET (JsonPath.Net)
Not supported
Could not find any valid selectors.
dotNET (JsonPathLib)
[
"third"
]
dotNET (Manatee.Json)
[]
Errors
JavaScript (json-p3)
unexpected shorthand selector '2' ('$.2':2)
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.