Dot notation with single quotes and dot
Setup
Selector: $.'some.key'
{"some.key": 42, "some": {"key": "value"}, "'some.key'": 43}
Results
Other responses
Bash (JSONPath.sh)
[
42
]
C (json-glib)
[]
Clojure (json-path)
¹
"value"
Cpp (jsoncons)
[
42
]
Dart (json_path)
Not supported
Instance of 'ParserException': end of input expected (at 1:2)
Elixir (ExJsonPath)
Not supported
syntax error before: {string,1,<<"some.key">>}
Elixir (jaxon)
[]
Elixir (warpath)
¹
Not supported
Parser error: Invalid token on line 1, syntax error before: <<"some.key">>
Not supported
parsing error: $.'some.key' :1:3 - 1:13 unexpected Char while scanning JSON select expected Ident, "." or "*"
42
Not supported
[]
Haskell (jsonpath)
Not supported
Invalid JSONPath: $.'some.key'
Error: 1:3:
|
1 | $.'some.key'
| ^
unexpected '''
expecting '.' or white space
JavaScript (Goessner)
²
[
"value"
]
JavaScript (brunerd)
Not supported
JavaScript (jsonpath)
Not supported
Parse error on line 1:
$.'some.key'
--^
Expecting 'STAR', 'IDENTIFIER', 'SCRIPT_EXPRESSION', 'INTEGER', 'END', got 'Q_STRING'
JavaScript (jsonpath-plus)
[
"value"
]
JavaScript (jsonpathly)
Not supported
mismatched input ''some.key'' expecting {'*', 'true', 'false', 'null', KEY, SPECIAL_KEY, NUMBER}
Java (com.github.jsurfer)
Not supported
line 1:2 no viable alternative at input '.'some.key''
org.antlr.v4.runtime.misc.ParseCancellationException
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: Missing property in path $[''some']
Kotlin (com.nfeld.jsonpathkt)
¹
null
Objective-C (SMJJSONPath)
¹
³
Not found
Missing property in path $[''some']
PHP (Goessner)
²
[
"value"
]
PHP (galbar-jsonpath)
Not supported
Invalid JSONPath error: 'Error in JSONPath near '.'some.key'''
PHP (remorhaz-jsonpath)
[
42
]
PHP (softcreatr-jsonpath)
Not supported
Error: 'Unable to parse token 'some in expression: .'some.key''
Perl (JSON-Path)
[
42
]
Python (jsonpath)
²
[
"value"
]
Python (jsonpath-ng)
[
42
]
Python (jsonpath-rw)
[
42
]
Python (jsonpath2)
Not supported
line 1:2 token recognition error at: '''
ValueError("line 1:2 token recognition error at: '''")
Python (python-jsonpath)
Not supported
JSONPathSyntaxError("unexpected token 'some.key'")
Raku (JSON-Path)
Not supported
JSON path parse error at position 1
Ruby (jsonpath)
[
42
]
Rust (jsonpath)
Not supported
parsing error
Rust (jsonpath_lib)
Not supported
path error:
$.'some.key'
^^
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)
[
42
]
dotNET (JsonPath.Net)
Not supported
Could not find any valid selectors.
dotNET (JsonPathLib)
[
"value"
]
dotNET (Manatee.Json)
[
42
]
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}
key error: 'some not found in object
unexpected end of file
Rust (jsonpath_plus)
Error Parsing JSON Path:
$.'some.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.