Dot notation with space padded key
Setup
Selector: $. a
{" a": 1, "a": 2, " a ": 3, "": 4}
Results
Other responses
Bash (JSONPath.sh)
[
3
]
C (json-glib)
[
3
]
Clojure (json-path)
¹
2
Cpp (jsoncons)
[
2
]
Dart (json_path)
Not supported
Instance of 'ParserException': end of input expected (at 1:2)
Elixir (ExJsonPath)
[
2
]
Elixir (jaxon)
[
3
]
Elixir (warpath)
¹
2
Erlang (ejsonpath)
[
2
]
2
2
Not supported
3
[
3
]
Not supported
jsonpath: unexpected blank space at position 3
Not supported
child name missing at position 2, following "$."
Haskell (jsonpath)
Not supported
Invalid JSONPath: $. a
Error: 1:3:
|
1 | $. a
| ^
unexpected space
expecting '.' or white space
JavaScript (Goessner)
²
[
3
]
JavaScript (brunerd)
Not supported
JavaScript (jsonpath)
Not supported
Lexical error on line 1. Unrecognized text.
$. a
--^
JavaScript (jsonpath-plus)
[
3
]
JavaScript (jsonpathly)
[
2
]
Java (com.github.jsurfer)
[
2
]
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>3</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>3</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)
¹
³
Not supported
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.InvalidPathException: Could not parse token starting at position 2
Kotlin (com.nfeld.jsonpathkt)
¹
1
Objective-C (SMJJSONPath)
¹
³
Not supported
Could not parse token starting at position 2
PHP (Goessner)
²
[
3
]
PHP (galbar-jsonpath)
Not supported
Invalid JSONPath error: 'Error in JSONPath near '. a ''
PHP (remorhaz-jsonpath)
Not supported
Error: 'Failed to build AST from JSONPath query: $. a '
PHP (softcreatr-jsonpath)
Not supported
Error: 'Unable to parse token a in expression: . a'
Perl (JSON-Path)
[
3
]
Python (jsonpath)
²
[
3
]
Python (jsonpath-ng)
[
2
]
Python (jsonpath-rw)
[
2
]
Python (jsonpath2)
[
2
]
Python (python-jsonpath)
Not supported
JSONPathSyntaxError('expected a shorthand selector')
Raku (JSON-Path)
Not supported
JSON path parse error at position 1
Ruby (jsonpath)
[
1
]
Rust (jsonpath)
Not supported
parsing error
Rust (jsonpath_lib)
Not supported
path error:
$. a
^^
Rust (serde_json_path)
Not supported
at position 2, in dot member name, must start with lowercase alpha or '_'
Scala (jsonpath)
[
2
]
Swift (Sextant)
Not supported
NOT_SUPPORTED
dotNET (Json.NET)
Not supported
Unexpected character while parsing path:
dotNET (JsonCons.JsonPath)
[
2
]
dotNET (JsonPath.Net)
[
1
]
dotNET (JsonPathLib)
[
3
]
dotNET (Manatee.Json)
Not supported
Unrecognized JSON Path element. Path up to error: '$'
Errors
JavaScript (json-p3)
unexpected whitespace after dot ('$. a ':3)
Rust (jsonpath_plus)
Error Parsing JSON Path:
$. a
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.