Filter expression with equals string with unicode character escape
Setup
Selector: $[?(@.key=="Mot\u00f6rhead")]
[
{"key": "something"},
{"key": "Mot\u00f6rhead"},
{"key": "mot\u00f6rhead"},
{"key": "Motorhead"},
{"key": "Motoo\u0308rhead"},
{"key": "motoo\u0308rhead"}
]
Results
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
Not supported
Unable to compile selector `$[?(@.key=="Mot\u00f6rhead")]': Invalid array index definition “?(@.key=="Mot\u00f6rhead")]”
Clojure (json-path)
¹
[]
Cpp (jsoncons)
[
{
"key": "Mot\u00f6rhead"
}
]
Dart (json_path)
[
{
"key": "Mot\u00f6rhead"
}
]
Elixir (ExJsonPath)
[]
Elixir (jaxon)
[]
Elixir (warpath)
¹
[]
Erlang (ejsonpath)
[]
[
{
"key": "Mot\u00f6rhead"
}
]
[
{
"key": "Mot\u00f6rhead"
}
]
[
{
"key": "Mot\u00f6rhead"
}
]
[]
[
{
"key": "Mot\u00f6rhead"
}
]
[]
Haskell (jsonpath)
Not supported
Invalid JSONPath: $[?(@.key=="Mot\u00f6rhead")]
Error: 1:16:
|
1 | $[?(@.key=="Mot\u00f6rhead")]
| ^
unexpected '\'
expecting '!', '"', literal character, or white space
JavaScript (Goessner)
²
[
{
"key": "Mot\u00f6rhead"
}
]
JavaScript (brunerd)
[
{
"key": "Mot\u00f6rhead"
}
]
JavaScript (jsonpath)
[
{
"key": "Mot\u00f6rhead"
}
]
JavaScript (jsonpath-plus)
[
{
"key": "Mot\u00f6rhead"
}
]
JavaScript (jsonpathly)
[]
Java (com.github.jsurfer)
[]
Java (com.jayway.jsonpath)
¹
³
[
{
"key": "Mot\u00f6rhead"
}
]
Kotlin (com.nfeld.jsonpathkt)
¹
Not supported
Unexpected char, char=?, index=2
Objective-C (SMJJSONPath)
¹
³
[]
PHP (galbar-jsonpath)
[]
PHP (remorhaz-jsonpath)
Not supported
Error: 'Failed to build AST from JSONPath query: $[?(@.key=="Mot\u00f6rhead")]'
PHP (softcreatr-jsonpath)
[]
Python (jsonpath)
²
[
{
"key": "Mot\u00f6rhead"
}
]
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)
Not supported
line 1:10 extraneous input '=' expecting {'@', '$', 'true', 'false', 'null', '{', '[', STRING, NUMBER}
ValueError("line 1:10 extraneous input '=' expecting {'@', '$', 'true', 'false', 'null', '{', '[', STRING, NUMBER}")
Python (python-jsonpath)
[]
Raku (JSON-Path)
Not supported
Evaluation of embedded Perl 6 code not allowed (construct with :allow-eval)
Ruby (jsonpath)
[]
Rust (jsonpath)
Not supported
parsing error
Rust (jsonpath_lib)
[]
Rust (jsonpath_plus)
[]
Scala (jsonpath)
[]
Swift (Sextant)
[
{
"key": "Mot\u00f6rhead"
}
]
dotNET (Json.NET)
Not supported
Unexpected character while parsing path query: "
dotNET (JsonCons.JsonPath)
[
{
"key": "Mot\u00f6rhead"
}
]
dotNET (JsonPath.Net)
[
{
"key": "Mot\u00f6rhead"
}
]
dotNET (JsonPathLib)
[
{
"key": "Mot\u00f6rhead"
}
]
dotNET (Manatee.Json)
[
{
"key": "Mot\u00f6rhead"
}
]
JSON (Path_Reference_Implementation)
Not supported
--> 1:3
|
1 | $[?(@.key=="Mot\u00f6rhead")]
| ^---
|
= expected unionChild, unionArrayIndex, or sliceStart
Proposal (A)
[]
Errors
PHP (Goessner)
²
ArgumentCountError
Perl (JSON-Path)
non-safe evaluation, died at main.pl line 11.
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.