Union with slice and number
Setup
Selector: $[1:3,4]
[1,2,3,4,5]
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
Not supported
Unable to compile selector `$[1:3,4]': Invalid slice definition “1:3,4]”
Clojure (json-path)
¹
2
Cpp (jsoncons)
[
2,
3,
5
]
Dart (json_path)
[
2,
3,
5
]
Elixir (ExJsonPath)
[
2,
3,
5
]
Elixir (jaxon)
[]
Elixir (warpath)
¹
Not supported
Parser error: Invalid token on line 1, syntax error before: <<",">>
Erlang (ejsonpath)
Not supported
syntax error before: ','
[
2,
3,
5
]
Not supported
parsing error: $[1:3,4] :1:6 - 1:7 mixed 58 and 44 in JSON bracket
Not supported
[
2,
3,
5
]
Haskell (jsonpath)
[
2,
3,
5
]
JavaScript (Goessner)
²
[
2,
3,
5
]
JavaScript (brunerd)
[
2,
3,
5
]
JavaScript (jsonpath)
[
2,
3,
5
]
JavaScript (jsonpath-plus)
[
2,
3,
5
]
Java (com.github.jsurfer)
Not supported
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: Failed to parse SliceOperation: 1:3,4
Kotlin (com.nfeld.jsonpathkt)
¹
[
2,
3
]
Objective-C (SMJJSONPath)
¹
³
Not supported
Failed to parse SliceOperation: 1:3,4
PHP (Goessner)
²
[
2,
3,
5
]
PHP (galbar-jsonpath)
²
Not supported
Invalid JSONPath error: 'Error in JSONPath near '1:3,4''
PHP (remorhaz-jsonpath)
Not supported
Error: 'Failed to build AST from JSONPath query: $[1:3,4]'
PHP (softcreatr-jsonpath)
[
2,
3
]
Perl (JSON-Path)
[
2,
3
]
Python (jsonpath)
²
[
2,
3,
5
]
Python (jsonpath-ng)
Not supported
JsonPathParserError('Parse error at 1:5 near token , (,)')
Python (jsonpath-rw)
Not supported
Exception('Parse error at 1:5 near token , (,)')
Python (jsonpath2)
[
2,
3,
5
]
Raku (JSON-Path)
Not supported
JSON path parse error at position 1
Ruby (jsonpath)
[
2,
3,
5
]
Rust (jsonpath)
Not supported
parsing error
Rust (jsonpath_lib)
Not supported
path error:
$[1:3,4]
^^^^^^
Rust (jsonpath_plus)
[
2,
3,
5
]
Scala (jsonpath)
Not supported
JPError(end of input expected)
Swift (Sextant)
Not supported
NOT_SUPPORTED
dotNET (Json.NET)
[
4,
5
]
dotNET (JsonCons.JsonPath)
[
2,
3,
5
]
dotNET (JsonPath.Net)
[
2,
3,
5
]
dotNET (JsonPathLib)
[
2,
3,
5
]
dotNET (Manatee.Json)
[
2,
3,
5
]
JSON (Path_Reference_Implementation)
[
2,
3,
5
]
Proposal (A)
[
2,
3,
5
]
Errors
path: invalid character at 5
strconv.Atoi: parsing "3,4": invalid syntax
wrong request: wrong request: 1:3,4
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.