Filter expression with current object

Setup

Selector: $[?(@)]

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

Results

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

Not supported

Unable to compile selector `$[?(@)]': Invalid array index definition “?(@)]”

Clojure (json-path) ¹

[
  "some value",
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

Cpp (jsoncons)

[
  "some value",
  "value",
  0,
  1,
  -1,
  true
]

Dart (json_path)

[
  "some value",
  "value",
  1,
  -1,
  [],
  {},
  true
]

Elixir (ExJsonPath)

Not supported

syntax error before: ')'

Elixir (jaxon)

[]

Elixir (warpath) ¹

Not supported

Parser error: Invalid token on line 1, syntax error before: <<")">>

Erlang (ejsonpath)

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

Golang (github.com-PaesslerAG-jsonpath) ¹

[
  1,
  -1,
  true
]

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

[
  "some value",
  "value",
  1,
  -1,
  [],
  {},
  true
]

Golang (github.com-ohler55-ojg)

Not supported

Golang (github.com-oliveagle-jsonpath) ¹

[
  []
]

Golang (github.com-spyzhov-ajson)

[
  "some value",
  "value",
  1,
  -1,
  true
]

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

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

Haskell (jsonpath)

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

JavaScript (Goessner) ²

[
  "some value",
  "value",
  1,
  -1,
  [],
  {},
  true
]

JavaScript (brunerd)

[
  "some value",
  "value",
  1,
  [],
  {},
  true
]

JavaScript (jsonpath)

[
  "some value",
  "value",
  1,
  -1,
  [],
  {},
  true
]

Java (com.github.jsurfer)

Not supported

line 1:5 no viable alternative at input '@)]'
org.antlr.v4.runtime.misc.ParseCancellationException

Java (com.jayway.jsonpath) ¹ ³

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=2

Objective-C (SMJJSONPath) ¹ ³

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

PHP (galbar-jsonpath) ²

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  [],
  true
]

PHP (remorhaz-jsonpath)

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

Python (jsonpath) ²

[
  "some value",
  "value",
  1,
  -1,
  true
]

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)

[
  [
    "some value",
    null,
    "value",
    0,
    1,
    -1,
    "",
    [],
    {},
    false,
    true
  ]
]

Raku (JSON-Path)

Not supported

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

Ruby (jsonpath)

[
  "some value",
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  true
]

Rust (jsonpath)

Not supported

parsing error

Rust (jsonpath_lib)

[
  [
    "some value",
    null,
    "value",
    0,
    1,
    -1,
    "",
    [],
    {},
    false,
    true
  ]
]

Rust (jsonpath_plus)

[
  true
]

Scala (jsonpath)

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

Swift (Sextant)

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

dotNET (Json.NET)

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

dotNET (JsonCons.JsonPath)

[
  "some value",
  "value",
  0,
  1,
  -1,
  true
]

dotNET (JsonPath.Net)

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

dotNET (Manatee.Json)

Not supported

Sequence contains no elements

JSON (Path_Reference_Implementation)

Not supported

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

Proposal (A)

[
  "some value",
  null,
  "value",
  0,
  1,
  -1,
  "",
  [],
  {},
  false,
  true
]

Errors

JavaScript (jsonpath-plus)

jsonPath: Invalid or unexpected token: @

PHP (Goessner) ²

ArgumentCountError

PHP (softcreatr-jsonpath)

Error: 'Malformed filter query'

Perl (JSON-Path)

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

dotNET (JsonPathLib)

Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'System.IConvertible'.

Footnotes