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)

Not supported

Instance of 'ParserException': end of input expected (at 1:2)

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-PaesslerAG-jsonpath) ¹

[]

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

[]

Golang (github.com-ohler55-ojg)

[]

Golang (github.com-oliveagle-jsonpath) ¹

[
  []
]

Golang (github.com-spyzhov-ajson)

[]

Golang (github.com-theory-jsonpath)

Not supported

jsonpath: invalid comparison operator at position 9

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)

[]

JavaScript (jsonpathly)

[]

Java (com.github.jsurfer)

Not supported

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

Java (com.github.xmljacquard.ajp)

Not supported

Error at char 18 in expression in xsl:sequence/@select on line 20 column 67 of ajp-runner.xslt:
   <failed xmlns:ixml="http://invisiblexml.org/NS"
  ixml:state="failed"><line>1</line><column>9</column><pos>9</pos><unexpected>)</unexpected><permitted>#9, #A, #D, ' ', '!', '&lt;', '=', '&gt;', '_', ['0'-'9'], ['a'-'z']</permitted><completions><completed rule="null" start="5" end="8"><input>null</input></completed><completed rule="literal" start="5" end="8"><input>null</input></completed><completed rule="comparable" start="5" end="8"><input>null</input></completed><completed rule="function-name" start="5" end="8"><input>null</input></completed></completions><could-be-next><in rule="function-name-char"><tokens>'_'</tokens></in><in rule="comparison-op"><tokens>'!', '&lt;', '=', '&gt;'</tokens></in><in rule="DIGIT"><tokens>['0'-'9']</tokens></in><in rule="LCALPHA"><tokens>['a'-'z']</tokens></in><in rule="B"><tokens>#9, #A, #D, ' '</tokens></in></could-be-next><unfinished><open rule="comparison-expr" start="5" end="8"><input>null</input></open><open rule="paren-expr" start="4" end="4"><input>(</input></open><open rule="filter-selector" start="3" end="3"><input>?</input></open><open rule="bracketed-selection" start="2" end="2"><input>[</input></open><open rule="jsonpath-query" start="1" end="1"><input>$</input></open></unfinished></failed>
During lazy evaluation of tailCallLoop(ajp:getProcessor(...)) on line 20 of jar:file:./implementations/Java_com.github.xmljacquard.ajp/build/deps/org/xmljacquard/ajp/0.0.7/ajp-0.0.7.jar!/xslt/ajp-runner.xslt
In function ajpr:getProcessor on line 17 column 106 of ajp-runner.xslt:
net.sf.saxon.s9api.SaxonApiException: <failed xmlns:ixml="http://invisiblexml.org/NS" ixml:state="failed"><line>1</line><column>9</column><pos>9</pos><unexpected>)</unexpected><permitted>#9, #A, #D, ' ', '!', '&lt;', '=', '&gt;', '_', ['0'-'9'], ['a'-'z']</permitted><completions><completed rule="null" start="5" end="8"><input>null</input></completed><completed rule="literal" start="5" end="8"><input>null</input></completed><completed rule="comparable" start="5" end="8"><input>null</input></completed><completed rule="function-name" start="5" end="8"><input>null</input></completed></completions><could-be-next><in rule="function-name-char"><tokens>'_'</tokens></in><in rule="comparison-op"><tokens>'!', '&lt;', '=', '&gt;'</tokens></in><in rule="DIGIT"><tokens>['0'-'9']</tokens></in><in rule="LCALPHA"><tokens>['a'-'z']</tokens></in><in rule="B"><tokens>#9, #A, #D, ' '</tokens></in></could-be-next><unfinished><open rule="comparison-expr" start="5" end="8"><input>null</input></open><open rule="paren-expr" start="4" end="4"><input>(</input></open><open rule="filter-selector" start="3" end="3"><input>?</input></open><open rule="bracketed-selection" start="2" end="2"><input>[</input></open><open rule="jsonpath-query" start="1" end="1"><input>$</input></open></unfinished></failed>

Java (com.jayway.jsonpath) ¹ ³

Not supported

SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders 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)

[]

Python (python-jsonpath)

Not supported

JSONPathSyntaxError('filter expression literals outside of function expressions must be compared')

Raku (JSON-Path)

Not supported

Evaluation of embedded Raku 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)

[]

Rust (serde_json_path)

Not supported

at position 8, in long-hand segment, parser error

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,
  ""
]

Errors

JavaScript (json-p3)

filter expression literals (null) must be compared ('$[?(null)':4)

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