Filter expression with dot notation with dash

Setup

Selector: $[?(@.key-dash == 'value')]

[
   {
     "key-dash": "value"
   }
]

Results

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

Not supported

Unable to compile selector `$[?(@.key-dash == 'value')]': Invalid array index definition “?(@.key-dash == 'value')]”

Clojure (json-path) ¹

[]

Cpp (jsoncons)

Not supported

JSON syntax_error at line 1 and column 15

Dart (json_path)

[
  {
    "key-dash": "value"
  }
]

Elixir (ExJsonPath)

Not supported

illegal characters "-d"

Elixir (jaxon)

[]

Elixir (warpath) ¹

[
  {
    "key-dash": "value"
  }
]

Erlang (ejsonpath)

Not supported

syntax error before: '=='

Golang (github.com-PaesslerAG-jsonpath) ¹

Not supported

parsing error: $[?(@.key-dash == 'value')]	:1:10 - 1:11 unexpected "-" while scanning parentheses expected ")"

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

[]

Golang (github.com-ohler55-ojg)

Not supported

Golang (github.com-oliveagle-jsonpath) ¹

[]

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

[
  {
    "key-dash": "value"
  }
]

Haskell (jsonpath)

[
  {
    "key-dash": "value"
  }
]

JavaScript (brunerd)

Not supported

JavaScript (jsonpath)

[]

Java (com.github.jsurfer)

[
  {
    "key-dash": "value"
  }
]

Java (com.jayway.jsonpath) ¹ ³

[
  {
    "key-dash": "value"
  }
]

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=2

Objective-C (SMJJSONPath) ¹ ³

[
  {
    "key-dash": "value"
  }
]

PHP (galbar-jsonpath) ²

[
  {
    "key-dash": "value"
  }
]

PHP (remorhaz-jsonpath)

[
  {
    "key-dash": "value"
  }
]

PHP (softcreatr-jsonpath)

[
  {
    "key-dash": "value"
  }
]

Python (jsonpath) ²

Not found

jsonpath returned false, this might indicate an error

Python (jsonpath-ng)

Not supported

JsonPathLexerError('Error on line 1, col 2: Unexpected character: ? ')

Python (jsonpath-rw)

Not supported

JsonPathLexerError('Error on line 1, col 2: Unexpected character: ? ')

Python (jsonpath2)

Not supported

line 1:9 token recognition error at: '-d'
ValueError("line 1:9 token recognition error at: '-d'")

Raku (JSON-Path)

Not supported

Evaluation of embedded Perl 6 code not allowed (construct with :allow-eval)

Ruby (jsonpath)

[]

Rust (jsonpath)

[
  {
    "key-dash": "value"
  }
]

Rust (jsonpath_lib)

[
  {
    "key-dash": "value"
  }
]

Rust (jsonpath_plus)

[
  {
    "key-dash": "value"
  }
]

Scala (jsonpath)

[
  {
    "key-dash": "value"
  }
]

Swift (Sextant)

[
  {
    "key-dash": "value"
  }
]

dotNET (Json.NET)

[
  {
    "key-dash": "value"
  }
]

dotNET (JsonCons.JsonPath)

Not supported

Expected function

dotNET (JsonPath.Net)

Not supported

Error parsing path index value

dotNET (Manatee.Json)

Not supported

Unrecognized JSON Path Expression element. Path up to error: '$'

JSON (Path_Reference_Implementation)

Not supported

 --> 1:3
  |
1 | $[?(@.key-dash == 'value')]
  |   ^---
  |
  = expected unionChild, unionArrayIndex, or sliceStart

Proposal (A)

[
  {
    "key-dash": "value"
  }
]

Errors

Golang (github.com-spyzhov-ajson)

wrong request: wrong request: ?(@.key-dash == 'value')

JavaScript (Goessner) ²

jsonPath: dash is not defined: _v.key-dash == 'value'

JavaScript (jsonpath-plus)

jsonPath: dash is not defined: _$_v.key-dash == 'value'

PHP (Goessner) ²

ArgumentCountError

Perl (JSON-Path)

non-safe evaluation, died at main.pl line 11.

dotNET (JsonPathLib)

dash is not defined

Footnotes