Dot bracket notation

Setup

Selector: $.['key']

{
  "key": "value",
  "other": {"key": [{"key": 42}]}
}

Results

Other responses

Bash (JSONPath.sh)

[
  "value"
]

C (json-glib)

Not supported

Unable to compile selector `$.['key']': Missing member name or wildcard after . character

Cpp (jsoncons)

Not supported

Expected unquoted string, or single or double quoted string, or index or '*' at line 1 and column 3

Dart (json_path)

Not supported

FormatException: end of input expected at 1:2. Expression: $.['key']

Elixir (ExJsonPath)

Not supported

syntax error before: '['

Elixir (jaxon)

[]

Elixir (warpath) ¹

"value"

Erlang (ejsonpath)

Not supported

syntax error before: '['

Golang (github.com-PaesslerAG-jsonpath) ¹

Not supported

parsing error: $.['key']	:1:3 - 1:4 unexpected "[" while scanning JSON select expected Ident, "." or "*"

Golang (github.com-bhmj-jsonslice) ¹ ³

"value"

Golang (github.com-ohler55-ojg)

Not supported

Golang (github.com-spyzhov-ajson)

[
  "value"
]

Golang (github.com-vmware-labs-yaml-jsonpath)

Not supported

child name missing at position 2, following "$."

Haskell (jsonpath)

Not supported

Invalid JSONPath: $.['key']
 Error: 1:3:
  |
1 | $.['key']
  |   ^
unexpected '['
expecting '.' or white space

JavaScript (Goessner) ²

[
  "value",
  [
    {
      "key": 42
    }
  ],
  42
]

JavaScript (brunerd)

Not supported

JavaScript (jsonpath)

Not supported

Parse error on line 1:
$.['key']
--^
Expecting 'STAR', 'IDENTIFIER', 'SCRIPT_EXPRESSION', 'INTEGER', 'END', got '['

JavaScript (jsonpath-plus)

[
  "value",
  [
    {
      "key": 42
    }
  ],
  42
]

Java (com.github.jsurfer)

Not supported

line 1:2 no viable alternative at input '.['
org.antlr.v4.runtime.misc.ParseCancellationException

Java (com.jayway.jsonpath) ¹ ³

"value"

Kotlin (com.nfeld.jsonpathkt) ¹

"value"

Objective-C (SMJJSONPath) ¹ ³

"value"

PHP (Goessner) ²

[
  "value",
  [
    {
      "key": 42
    }
  ],
  42
]

PHP (galbar-jsonpath) ²

Not supported

Invalid JSONPath error: 'Error in JSONPath near '.['key']''

PHP (remorhaz-jsonpath)

[
  "value"
]

PHP (softcreatr-jsonpath)

[
  "value"
]

Perl (JSON-Path)

[
  "value"
]

Python (jsonpath) ²

[
  "value",
  [
    {
      "key": 42
    }
  ],
  42
]

Python (jsonpath-ng)

[
  "value"
]

Python (jsonpath-rw)

[
  "value"
]

Python (jsonpath2)

Not supported

line 1:3 token recognition error at: '''
ValueError("line 1:3 token recognition error at: '''")

Raku (JSON-Path)

Not supported

JSON path parse error at position 1

Ruby (jsonpath)

[
  "value"
]

Rust (jsonpath)

Not supported

parsing error

Rust (jsonpath_lib)

[
  "value"
]

Scala (jsonpath)

Not supported

JPError(end of input expected)

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)

[
  "value",
  [
    {
      "key": 42
    }
  ],
  42
]

dotNET (JsonPathLib)

[
  "value",
  [
    {
      "key": 42
    }
  ],
  42
]

dotNET (Manatee.Json)

[
  "value"
]

JSON (Path_Reference_Implementation)

Not supported

 --> 1:3
  |
1 | $.['key']
  |   ^---
  |
  = expected childName

Proposal (A)

Not supported


x 1:3-1:3 DotChildName
| $.['key']
|   ^
x 1:2-1:2 DotChild
| $.['key']
|  ^
x 1:2-1:2 Operator
| $.['key']
|  ^
o 1:1-1:2 Start
  $.['key']
  ^

Errors

Clojure (json-path) ¹

java.lang.Exception object must be an array.

Golang (github.com-oliveagle-jsonpath) ¹

strconv.Atoi: parsing "'key'": invalid syntax

Rust (jsonpath_plus)

Error Parsing JSON Path:
$.['key']
panic occurred

Footnotes