Dot notation with key root literal
Setup
Selector: $.$
{
"$": "value"
}
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
[
"value"
]
Clojure (json-path)
¹
{
"$": "value"
}
Cpp (jsoncons)
[]
Dart (json_path)
Not supported
Instance of 'ParserException': end of input expected (at 1:2)
Elixir (ExJsonPath)
Not supported
syntax error before: '$'
Elixir (jaxon)
[]
Elixir (warpath)
¹
Not supported
Parser error: Invalid token on line 1, syntax error before: <<"$">>
Erlang (ejsonpath)
Not supported
syntax error before: '$'
Not supported
parsing error: $.$ :1:3 - 1:4 unexpected "$" while scanning JSON select expected Ident, "." or "*"
"value"
Not supported
[
{
"$": "value"
}
]
Not supported
jsonpath: unexpected '$' at position 3
[
"value"
]
Haskell (jsonpath)
Not supported
Invalid JSONPath: $.$
Error: 1:3:
|
1 | $.$
| ^
unexpected '$'
expecting '.' or white space
JavaScript (Goessner)
²
[
"value"
]
JavaScript (brunerd)
[
"value"
]
JavaScript (jsonpath)
Not supported
Parse error on line 1:
$.$
--^
Expecting 'STAR', 'IDENTIFIER', 'SCRIPT_EXPRESSION', 'INTEGER', 'END', got 'DOLLAR'
JavaScript (jsonpath-plus)
[
{
"$": "value"
}
]
JavaScript (jsonpathly)
Not supported
mismatched input '$' expecting {'*', 'true', 'false', 'null', KEY, SPECIAL_KEY, NUMBER}
Java (com.github.jsurfer)
Not supported
line 1:2 no viable alternative at input '.$'
org.antlr.v4.runtime.misc.ParseCancellationException
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>$</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>$</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)
¹
³
"value"
Kotlin (com.nfeld.jsonpathkt)
¹
"value"
Objective-C (SMJJSONPath)
¹
³
"value"
PHP (Goessner)
²
[
"value"
]
PHP (galbar-jsonpath)
[
"value"
]
PHP (remorhaz-jsonpath)
Not supported
Error: 'Failed to build AST from JSONPath query: $.$'
PHP (softcreatr-jsonpath)
Not supported
Error: 'Unable to parse token $ in expression: .$'
Python (jsonpath)
²
[
"value"
]
Python (jsonpath-ng)
[
{
"$": "value"
}
]
Python (jsonpath-rw)
[
{
"$": "value"
}
]
Python (jsonpath2)
Not supported
line 1:2 mismatched input '$' expecting {'*', ID}
ValueError("line 1:2 mismatched input '$' 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)
[
{
"$": "value"
}
]
Rust (jsonpath)
Not supported
parsing error
Rust (jsonpath_lib)
Not supported
path error:
$.$
^^
Rust (serde_json_path)
Not supported
at position 2, in dot member name, must start with lowercase alpha or '_'
Scala (jsonpath)
[
"value"
]
Swift (Sextant)
[
"value"
]
dotNET (Json.NET)
[
"value"
]
dotNET (JsonCons.JsonPath)
Not supported
Expected unquoted string, or single or double quoted string, or index or '*'
dotNET (JsonPath.Net)
Not supported
Could not find any valid selectors.
dotNET (JsonPathLib)
[
"value"
]
dotNET (Manatee.Json)
Not supported
Unrecognized JSON Path element. Path up to error: '$'
Errors
expression don't support in filter
JavaScript (json-p3)
unexpected shorthand selector '$' ('$.$':2)
Perl (JSON-Path)
Assertion ("$" is not an operator) failed!
at build/lib/perl5/Carp/Assert.pm line 282, <STDIN> line 3.
Carp::Assert::assert(...) called at build/lib/perl5/JSON/Path/Evaluator.pm line 215
JSON::Path::Evaluator::_evaluate(...) called at build/lib/perl5/JSON/Path/Evaluator.pm line 120
JSON::Path::Evaluator::evaluate(...) called at build/lib/perl5/JSON/Path/Evaluator.pm line 93
JSON::Path::Evaluator::evaluate_jsonpath(...) called at build/lib/perl5/JSON/Path.pm line 103
JSON::Path::values(...) called at main.pl line 11
Rust (jsonpath_plus)
Error Parsing JSON Path:
$.$
panic occurred
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.