Dot notation with number
Setup
Selector: $.2
["first", "second", "third", "forth", "fifth"]
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
[]
Clojure (json-path)
¹
null
Cpp (jsoncons)
[
"third"
]
Dart (json_path)
[]
Elixir (ExJsonPath)
[
"third"
]
Elixir (jaxon)
[]
Elixir (warpath)
¹
null
Erlang (ejsonpath)
Not supported
syntax error before: 2
Not found
type unmatched (expected=object, found=[]interface {}, path=.2)
Not supported
parsing error: $.2 :1:2 - 1:4 unexpected Float while scanning operator
"third"
[]
[]
[
"third"
]
[]
Haskell (jsonpath)
[]
JavaScript (Goessner)
²
[
"third"
]
JavaScript (brunerd)
Not supported
JavaScript (jsonpath)
[
"third"
]
JavaScript (jsonpath-plus)
[
"third"
]
Java (com.github.jsurfer)
[
"third"
]
Java (com.jayway.jsonpath)
¹
³
Not found
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.PathNotFoundException: Expected to find an object with property ['2'] 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 ['2'] in path $ but found 'GSArray'. This is not a json object.
PHP (Goessner)
²
[
"third"
]
PHP (galbar-jsonpath)
²
[
"third"
]
PHP (remorhaz-jsonpath)
[]
PHP (softcreatr-jsonpath)
[
"third"
]
Perl (JSON-Path)
[
"third"
]
Python (jsonpath)
²
[
"third"
]
Python (jsonpath-ng)
Not supported
JsonPathParserError('Parse error at 1:2 near token 2 (NUMBER)')
Python (jsonpath-rw)
Not supported
Exception('Parse error at 1:2 near token 2 (NUMBER)')
Python (jsonpath2)
Not supported
line 1:2 mismatched input '2' expecting {'*', ID}
ValueError("line 1:2 mismatched input '2' expecting {'*', ID}")
Raku (JSON-Path)
Not supported
JSON path parse error at position 1
Ruby (jsonpath)
[]
Rust (jsonpath)
[]
Rust (jsonpath_lib)
[]
Rust (jsonpath_plus)
[]
Scala (jsonpath)
[]
Swift (Sextant)
[]
dotNET (Json.NET)
[]
dotNET (JsonCons.JsonPath)
[]
dotNET (JsonPath.Net)
Not supported
Could not find any valid selectors.
dotNET (JsonPathLib)
[
"third"
]
dotNET (Manatee.Json)
[]
JSON (Path_Reference_Implementation)
[]
Proposal (A)
[]
Footnotes
- ¹ This implementation returns a single value where only one match is possible (instead of an array of a single value).
- ² This implementation returns a specific not found value if no match exists.
- ³ This implementation returns a specific not found value if a query that would regularly return a single match results in no match.