Filter expression with value null

Setup

Selector: $[?(null)]

[1, 3, "nice", true, null, false, {}, [], -1, 0, ""]

Results

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

Not supported

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

Clojure (json-path) ¹

[]

Cpp (jsoncons)

[]

Dart (json_path)

[]

Elixir (ExJsonPath)

Not supported

syntax error before: <<"null">>

Elixir (jaxon)

[]

Elixir (warpath) ¹

Not supported

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

Erlang (ejsonpath)

Not supported

syntax error before: ')'

Golang (github.com-AsaiYusuke-jsonpath) ²

Not supported

invalid syntax (position=1, reason=unrecognized input, near=[?(null)])

Golang (github.com-PaesslerAG-jsonpath) ¹

[]

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

[]

Golang (github.com-ohler55-ojg)

Not supported

Golang (github.com-oliveagle-jsonpath) ¹

[
  []
]

Golang (github.com-spyzhov-ajson)

[]

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

[]

Haskell (jsonpath)

Not supported

Invalid JSONPath: $[?(null)]
 Error: 1:9:
  |
1 | $[?(null)]
  |         ^^
unexpected ")]"
expecting "!=", "<=", "==", ">=", '!', '<', '>', or white space

JavaScript (Goessner) ²

Not found

jsonpath returned false, this might indicate an error

JavaScript (brunerd)

[]

JavaScript (jsonpath)

[]

JavaScript (jsonpath-plus)

[]

Java (com.github.jsurfer)

Not supported

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

Java (com.jayway.jsonpath) ¹ ³

Not supported

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.InvalidPathException: Expected path node

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=2

Objective-C (SMJJSONPath) ¹ ³

Not supported

path node expected

PHP (galbar-jsonpath) ²

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  [],
  [],
  -1,
  0,
  ""
]

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)

[]

Raku (JSON-Path)

Not supported

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

Ruby (jsonpath)

[
  1,
  3,
  "nice",
  true,
  {},
  [],
  -1,
  0,
  ""
]

Rust (jsonpath)

Not supported

parsing error

Rust (jsonpath_lib)

Not supported

path error: 
$[?(null)]
^^^^^^^^

Rust (jsonpath_plus)

[]

Scala (jsonpath)

Not supported

JPError(end of input expected)

Swift (Sextant)

Not supported

NOT_SUPPORTED

dotNET (Json.NET)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

dotNET (JsonCons.JsonPath)

[]

dotNET (JsonPath.Net)

Not supported

Pattern '(null)]' not recognized.

dotNET (JsonPathLib)

[]

dotNET (Manatee.Json)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

JSON (Path_Reference_Implementation)

Not supported

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

Proposal (A)

Not supported


x 1:9-1:9 ComparisonOperator
| $[?(null)]
|         ^
x 1:5-1:5 HigherPrecedenceFilterExpression
| $[?(null)]
|     ^
| x 1:9-1:9 ComparisonOperator
| | $[?(null)]
| |         ^
| x 1:5-1:5 HigherPrecedenceFilterExpression
| | $[?(null)]
| |     ^
| x 1:5-1:5 LogicalOr
| | $[?(null)]
| |     ^
| | x 1:9-1:9 ComparisonOperator
| | | $[?(null)]
| | |         ^
| | x 1:5-1:5 HigherPrecedenceFilterExpression
| | | $[?(null)]
| | |     ^
| | x 1:5-1:5 LogicalAnd
| | | $[?(null)]
| | |     ^
| | | 
|/ /  
| | 
|/  
x 1:5-1:5 FilterExpression
| $[?(null)]
|     ^
x 1:3-1:3 BracketElement
| $[?(null)]
|   ^
x 1:3-1:3 BracketElements
| $[?(null)]
|   ^
x 1:2-1:2 BracketChildren
| $[?(null)]
|  ^
x 1:2-1:2 Operator
| $[?(null)]
|  ^
o 1:1-1:2 Start
  $[?(null)]
  ^

Errors

PHP (Goessner) ²

ArgumentCountError

PHP (remorhaz-jsonpath)

Error: 'Failed to execute JSONPath query: $[?(null)]

$var2 = $valueListFetcher->fetchFilterContext($input);
$var3 = $valueListFetcher->splitFilterContext($var2);
$var4 = $literalFactory->createScalar($var3, null);
$var5 = $evaluator->evaluate($var3, $var4);
$var6 = $valueListFetcher->joinFilterResults($var5, $var2);
$var7 = $valueListFetcher->fetchFilteredValues($var2, $var6);
return $var7;'

PHP (softcreatr-jsonpath)

Error: 'Malformed filter query'

Perl (JSON-Path)

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

Footnotes