Dot notation with number -1

Setup

Selector: $.-1

["first", "second", "third", "forth", "fifth"]

Results

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

[]

Clojure (json-path) ¹

null

Cpp (jsoncons)

Not supported

Expected '$' or function expression at line 1 and column 3

Dart (json_path)

Not supported

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

Elixir (ExJsonPath)

[
  "fifth"
]

Elixir (jaxon)

[]

Elixir (warpath) ¹

null

Erlang (ejsonpath)

Not supported

syntax error before: '-'

Golang (github.com-PaesslerAG-jsonpath) ¹

Not supported

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

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

"fifth"

Golang (github.com-ohler55-ojg)

Not supported

Golang (github.com-oliveagle-jsonpath) ¹

[]

Golang (github.com-spyzhov-ajson)

[
  "fifth"
]

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

[]

Haskell (jsonpath)

[]

JavaScript (Goessner) ²

Not found

jsonpath returned false, this might indicate an error

JavaScript (brunerd)

Not supported

JavaScript (jsonpath)

[]

JavaScript (jsonpath-plus)

[]

JavaScript (jsonpathly)

[
  "fifth"
]

Java (com.github.jsurfer)

[]

Java (com.jayway.jsonpath) ¹ ³

Not found

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.PathNotFoundException: Expected to find an object with property ['-1'] in path $ but found 'net.minidev.json.JSONArray'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.

Kotlin (com.nfeld.jsonpathkt) ¹

null

Objective-C (SMJJSONPath) ¹ ³

Not found

Expected to find an object with property ['-1'] in path $ but found 'GSArray'. This is not a json object.

PHP (Goessner) ²

Not found

jsonpath returned false, this might indicate an error

PHP (galbar-jsonpath)

Not supported

Invalid JSONPath error: 'Error in JSONPath near '.-1''

PHP (remorhaz-jsonpath)

Not supported

Error: 'Failed to build AST from JSONPath query: $.-1'

PHP (softcreatr-jsonpath)

[
  "fifth"
]

Perl (JSON-Path)

[
  "fifth"
]

Python (jsonpath) ²

Not found

jsonpath returned false, this might indicate an error

Python (jsonpath-ng)

Not supported

JsonPathParserError('Parse error at 1:2 near token -1 (NUMBER)')

Python (jsonpath-rw)

Not supported

Exception('Parse error at 1:2 near token -1 (NUMBER)')

Python (jsonpath2)

Not supported

line 1:2 mismatched input '-1' expecting {'*', ID}
ValueError("line 1:2 mismatched input '-1' expecting {'*', ID}")

Python (python-jsonpath)

Not supported

JSONPathSyntaxError("unexpected token '-1'")

Raku (JSON-Path)

Not supported

JSON path parse error at position 1

Ruby (jsonpath)

[]

Rust (jsonpath)

[]

Rust (jsonpath_lib)

[]

Rust (jsonpath_plus)

[]

Rust (serde_json_path)

Not supported

at position 2, in dot member name, must start with lowercase alpha or '_'

Scala (jsonpath)

[]

Swift (Sextant)

[]

dotNET (Json.NET)

[]

dotNET (JsonCons.JsonPath)

Not supported

Expected unquoted string, or single or double quoted string, or index or '*'

dotNET (JsonPath.Net)

Not supported

Could not find any valid selectors.

dotNET (JsonPathLib)

[]

dotNET (Manatee.Json)

Not supported

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

Footnotes