Dot notation with single quotes after recursive descent
Setup
Selector: $..'key'
{
"object": {
"key": "value",
"'key'": 100,
"array": [
{"key": "something", "'key'": 0},
{"key": {"key": "russian dolls"}, "'key'": {"'key'": 99}}
]
},
"key": "top",
"'key'": 42
}
Results
Other responses
Bash (JSONPath.sh)
[
"russian dolls",
"something",
"top",
"value"
]
C (json-glib)
[
0,
100,
42,
{
"'key'": 99
}
]
Clojure (json-path)
¹
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
Cpp (jsoncons)
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
Dart (json_path)
Not supported
Instance of 'ParserException': end of input expected (at 1:2)
Elixir (ExJsonPath)
Not supported
syntax error before: {string,1,<<"key">>}
Elixir (jaxon)
[
42
]
Elixir (warpath)
¹
Not supported
Parser error: Invalid token on line 1, syntax error before: <<"key">>
Not supported
parsing error: $..'key' :1:4 - 1:9 unexpected Char while scanning JSON mapper expected "[", Ident or "*"
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
Not supported
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
Not supported
jsonpath: unexpected string at position 4
[
0,
100,
42,
99,
{
"'key'": 99
}
]
Haskell (jsonpath)
Not supported
Invalid JSONPath: $..'key'
Error: 1:4:
|
1 | $..'key'
| ^
unexpected '''
expecting '.', '[', or white space
JavaScript (Goessner)
²
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
JavaScript (brunerd)
Not supported
JavaScript (jsonpath)
Not supported
Parse error on line 1:
$..'key'
---^
Expecting 'STAR', 'IDENTIFIER', 'SCRIPT_EXPRESSION', 'INTEGER', 'END', '[', got 'Q_STRING'
JavaScript (jsonpath-plus)
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
JavaScript (jsonpathly)
Not supported
mismatched input ''key'' expecting {'*', 'true', 'false', 'null', '[', KEY, SPECIAL_KEY}
Java (com.github.jsurfer)
Not supported
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>4</column><pos>4</pos><unexpected>'</unexpected><permitted>'*', '[', '_', [#80-'[xd7ff]'], ['A'-'Z'; 'a'-'z'], ['𐀀[x10000]'-'[x10ffef]'], ['[xe000]'-'[xffef]']</permitted><could-be-next><in rule="bracketed-selection"><tokens>'['</tokens></in><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="descendant-segment" start="2" end="3"><input>..</input></open><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>4</column><pos>4</pos><unexpected>'</unexpected><permitted>'*', '[', '_', [#80-''], ['A'-'Z'; 'a'-'z'], ['𐀀'-''], [''-'']</permitted><could-be-next><in rule="bracketed-selection"><tokens>'['</tokens></in><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="descendant-segment" start="2" end="3"><input>..</input></open><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)
¹
³
[
0,
100,
42,
99,
{
"'key'": 99
}
]
Kotlin (com.nfeld.jsonpathkt)
¹
[
0,
100,
42,
99,
{
"'key'": 99
}
]
Objective-C (SMJJSONPath)
¹
³
[
0,
100,
42,
99,
{
"'key'": 99
}
]
PHP (Goessner)
²
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
PHP (galbar-jsonpath)
Not supported
Invalid JSONPath error: 'Error in JSONPath near '.'key'''
PHP (remorhaz-jsonpath)
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
PHP (softcreatr-jsonpath)
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
Perl (JSON-Path)
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
Python (jsonpath)
²
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
Python (jsonpath-ng)
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
Python (jsonpath-rw)
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
Python (jsonpath2)
Not supported
line 1:3 token recognition error at: '''
ValueError("line 1:3 token recognition error at: '''")
Python (python-jsonpath)
Not supported
JSONPathSyntaxError('expected a shorthand selector')
Raku (JSON-Path)
Not supported
JSON path parse error at position 3
Ruby (jsonpath)
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
Rust (jsonpath)
Not supported
parsing error
Rust (jsonpath_lib)
Not supported
path error:
$..'key'
^^^^^^^^
Rust (serde_json_path)
Not supported
at position 3, must start with lowercase alpha or '_'
Scala (jsonpath)
[
0,
100,
42,
{
"'key'": 99
}
]
Swift (Sextant)
[
0,
100,
42,
99,
{
"'key'": 99
}
]
dotNET (Json.NET)
[
0,
100,
42,
99,
{
"'key'": 99
}
]
dotNET (JsonCons.JsonPath)
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
dotNET (JsonPath.Net)
Not supported
Could not find any valid selectors.
dotNET (JsonPathLib)
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
dotNET (Manatee.Json)
[
"russian dolls",
"something",
"top",
"value",
{
"key": "russian dolls"
}
]
Errors
Erlang (ejsonpath)
init terminating in do_boot (function_clause)
Crash dump is being written to: /dev/null...done
{"init terminating in do_boot",function_clause}
expression don't support in filter
JavaScript (json-p3)
unexpected descendent selection token ''' ('$..'key'':3)
Rust (jsonpath_plus)
Error Parsing JSON Path:
$..'key'
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.