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
FormatException: end of input expected at 1:2. Expression: $.'some.key'
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
invalid syntax (position=1, reason=unrecognized input, near=.'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"
]
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: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder 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: '''")
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'
^^
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
]
JSON (Path_Reference_Implementation)
Not supported
--> 1:3
|
1 | $.'some.key'
| ^---
|
= expected childName
Proposal (A)
Not supported
x 1:3-1:3 DotChildName
| $.'some.key'
| ^
x 1:2-1:2 DotChild
| $.'some.key'
| ^
x 1:2-1:2 Operator
| $.'some.key'
| ^
o 1:1-1:2 Start
$.'some.key'
^
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.