diff --git a/bug_reports/dotNET_JsonPathLib.md b/bug_reports/dotNET_JsonPathLib.md index a01876fbf..fb00e7d7e 100644 --- a/bug_reports/dotNET_JsonPathLib.md +++ b/bug_reports/dotNET_JsonPathLib.md @@ -493,53 +493,279 @@ The following queries provide results that do not match those of other implement ] ``` -- [ ] `$[?(@['@key']==42)]` +- [ ] `$..*[?(@.id>2)]` Input: ``` [ { - "@key": 0 + "complext": { + "one": [ + { + "name": "first", + "id": 1 + }, + { + "name": "next", + "id": 2 + }, + { + "name": "another", + "id": 3 + }, + { + "name": "more", + "id": 4 + } + ], + "more": { + "name": "next to last", + "id": 5 + } + } }, { - "@key": 42 + "name": "last", + "id": 6 + } + ] + ``` + Error: + ``` + Accessed JArray values with invalid key value: "id". Int32 array index expected. + ``` + +- [ ] `$..[?(@.id==2)]` + Input: + ``` + { + "id": 2, + "more": [ + { + "id": 2 + }, + { + "more": { + "id": 2 + } + }, + { + "id": { + "id": 2 + } + }, + [ + { + "id": 2 + } + ] + ] + } + ``` + Error: + ``` + Accessed JArray values with invalid key value: "id". Int32 array index expected. + ``` + +- [ ] `$[?(@.key>0 && false)]` + Input: + ``` + [ + { + "key": 1 }, { - "key": 42 + "key": 3 }, { - "@key": 43 + "key": "nice" }, { - "some": "value" + "key": true + }, + { + "key": null + }, + { + "key": false + }, + { + "key": {} + }, + { + "key": [] + }, + { + "key": -1 + }, + { + "key": 0 + }, + { + "key": "" } ] ``` - Expected output: + Error: ``` - [{"@key": 42}] + Accessed JArray values with invalid key value: "valueOf". Int32 array index expected. ``` - Actual output: + +- [ ] `$[?(@.key>0 && true)]` + Input: ``` - [] + [ + { + "key": 1 + }, + { + "key": 3 + }, + { + "key": "nice" + }, + { + "key": true + }, + { + "key": null + }, + { + "key": false + }, + { + "key": {} + }, + { + "key": [] + }, + { + "key": -1 + }, + { + "key": 0 + }, + { + "key": "" + } + ] + ``` + Error: + ``` + Accessed JArray values with invalid key value: "valueOf". Int32 array index expected. ``` -- [ ] `$[?(@[1]=='b')]` +- [ ] `$[?(@.key>0 || false)]` Input: ``` [ - [ - "a", - "b" - ], - [ - "x", - "y" - ] + { + "key": 1 + }, + { + "key": 3 + }, + { + "key": "nice" + }, + { + "key": true + }, + { + "key": null + }, + { + "key": false + }, + { + "key": {} + }, + { + "key": [] + }, + { + "key": -1 + }, + { + "key": 0 + }, + { + "key": "" + } + ] + ``` + Error: + ``` + Accessed JArray values with invalid key value: "valueOf". Int32 array index expected. + ``` + +- [ ] `$[?(@.key>0 || true)]` + Input: + ``` + [ + { + "key": 1 + }, + { + "key": 3 + }, + { + "key": "nice" + }, + { + "key": true + }, + { + "key": null + }, + { + "key": false + }, + { + "key": {} + }, + { + "key": [] + }, + { + "key": -1 + }, + { + "key": 0 + }, + { + "key": "" + } + ] + ``` + Error: + ``` + Accessed JArray values with invalid key value: "valueOf". Int32 array index expected. + ``` + +- [ ] `$[?(@['@key']==42)]` + Input: + ``` + [ + { + "@key": 0 + }, + { + "@key": 42 + }, + { + "key": 42 + }, + { + "@key": 43 + }, + { + "some": "value" + } ] ``` Expected output: ``` - [["a", "b"]] + [{"@key": 42}] ``` Actual output: ``` @@ -637,66 +863,81 @@ The following queries provide results that do not match those of other implement [] ``` -- [ ] `$[?(@.d==["v1","v2"])]` +- [ ] `$[?(@.key==42)]` Input: ``` [ { - "d": [ - "v1", - "v2" - ] + "key": 0 }, { - "d": [ - "a", - "b" - ] + "key": 42 }, { - "d": "v1" + "key": -1 }, { - "d": "v2" + "key": 1 }, { - "d": {} + "key": 41 }, { - "d": [] + "key": 43 }, { - "d": null + "key": 42.0001 }, { - "d": -1 + "key": 41.9999 }, { - "d": 0 + "key": 100 }, { - "d": 1 + "key": "some" }, { - "d": "['v1','v2']" + "key": "42" }, { - "d": "['v1', 'v2']" + "key": null }, { - "d": "v1,v2" + "key": 420 }, { - "d": "[\"v1\", \"v2\"]" + "key": "" }, { - "d": "[\"v1\",\"v2\"]" + "key": {} + }, + { + "key": [] + }, + { + "key": [ + 42 + ] + }, + { + "key": { + "key": 42 + } + }, + { + "key": { + "some": 42 + } + }, + { + "some": "value" } ] ``` Error: ``` - Object reference not set to an instance of an object. + Accessed JArray values with invalid key value: "valueOf". Int32 array index expected. ``` - [ ] `$[?(@[0:1]==[1])]` @@ -780,69 +1021,54 @@ The following queries provide results that do not match those of other implement ``` Error: ``` - Object reference not set to an instance of an object. + Accessed JArray values with invalid key value: "valueOf". Int32 array index expected. ``` -- [ ] `$[?(@.d==['v1','v2'])]` +- [ ] `$[?(@.key==false)]` Input: ``` [ { - "d": [ - "v1", - "v2" - ] - }, - { - "d": [ - "a", - "b" - ] - }, - { - "d": "v1" - }, - { - "d": "v2" + "some": "some value" }, { - "d": {} + "key": true }, { - "d": [] + "key": false }, { - "d": null + "key": null }, { - "d": -1 + "key": "value" }, { - "d": 0 + "key": "" }, { - "d": 1 + "key": 0 }, { - "d": "['v1','v2']" + "key": 1 }, { - "d": "['v1', 'v2']" + "key": -1 }, { - "d": "v1,v2" + "key": 42 }, { - "d": "[\"v1\", \"v2\"]" + "key": {} }, { - "d": "[\"v1\",\"v2\"]" + "key": [] } ] ``` Error: ``` - Object reference not set to an instance of an object. + Accessed JArray values with invalid key value: "valueOf". Int32 array index expected. ``` - [ ] `$[?(@[0:1]==1)]` @@ -936,83 +1162,141 @@ The following queries provide results that do not match those of other implement Line 1: Unexpected token *= ``` -- [ ] `$[?(@.d=={"k":"v"})]` +- [ ] `$[?(@.key=="value")]` Input: ``` [ { - "d": { - "k": "v" + "key": "some" + }, + { + "key": "value" + }, + { + "key": null + }, + { + "key": 0 + }, + { + "key": 1 + }, + { + "key": -1 + }, + { + "key": "" + }, + { + "key": {} + }, + { + "key": [] + }, + { + "key": "valuemore" + }, + { + "key": "morevalue" + }, + { + "key": [ + "value" + ] + }, + { + "key": { + "some": "value" } }, { - "d": { - "a": "b" + "key": { + "key": "value" } }, { - "d": "k" + "some": "value" + } + ] + ``` + Expected output: + ``` + [{"key": "value"}] + ``` + Error: + ``` + Accessed JArray values with invalid key value: "valueOf". Int32 array index expected. + ``` + +- [ ] `$[?(@.key=="hi@example.com")]` + Input: + ``` + [ + { + "key": "some" }, { - "d": "v" + "key": "value" }, { - "d": {} + "key": "hi@example.com" + } + ] + ``` + Expected output: + ``` + [{"key": "hi@example.com"}] + ``` + Actual output: + ``` + [] + ``` + +- [ ] `$[?(@.key==true)]` + Input: + ``` + [ + { + "some": "some value" }, { - "d": [] + "key": true }, { - "d": null + "key": false }, { - "d": -1 + "key": null }, { - "d": 0 + "key": "value" }, { - "d": 1 + "key": "" }, { - "d": "[object Object]" + "key": 0 }, { - "d": "{\"k\": \"v\"}" + "key": 1 }, { - "d": "{\"k\":\"v\"}" + "key": -1 }, - "v" - ] - ``` - Error: - ``` - Object reference not set to an instance of an object. - ``` - -- [ ] `$[?(@.key=="hi@example.com")]` - Input: - ``` - [ { - "key": "some" + "key": 42 }, { - "key": "value" + "key": {} }, { - "key": "hi@example.com" + "key": [] } ] ``` - Expected output: - ``` - [{"key": "hi@example.com"}] - ``` - Actual output: + Error: ``` - [] + Accessed JArray values with invalid key value: "valueOf". Int32 array index expected. ``` - [ ] `$.items[?(@.key==$.value)]` @@ -1097,7 +1381,47 @@ The following queries provide results that do not match those of other implement ``` Error: ``` - Object has no method 'length' + Property 'length' of object is not a function + ``` + +- [ ] `$[?(@.length == 4)]` + Input: + ``` + [ + [ + 1, + 2, + 3, + 4, + 5 + ], + [ + 1, + 2, + 3, + 4 + ], + [ + 1, + 2, + 3 + ] + ] + ``` + Expected output: + ``` + [] + ``` + Actual output: + ``` + [ + [ + 1, + 2, + 3, + 4 + ] + ] ``` - [ ] `$[?(@.key='value')]` @@ -1125,33 +1449,7 @@ The following queries provide results that do not match those of other implement ``` Error: ``` - Object of type 'System.String' cannot be converted to type 'Newtonsoft.Json.Linq.JToken'. - ``` - -- [ ] `$[?(!(@.d==["v1","v2"]) || (@.d == true))]` - Input: - ``` - [ - { - "d": [ - "v1", - "v2" - ] - }, - { - "d": [ - "a", - "b" - ] - }, - { - "d": true - } - ] - ``` - Error: - ``` - Object reference not set to an instance of an object. + String 'value' was not recognized as a valid Boolean. ``` - [ ] `$[?(@.a.*)]` @@ -1208,30 +1506,81 @@ The following queries provide results that do not match those of other implement Line 1: Unexpected token * ``` -- [ ] `$[?((@.d!=["v1","v2"]) || (@.d == true))]` +- [ ] `$[?(@.key!=42)]` Input: ``` [ { - "d": [ - "v1", - "v2" - ] + "key": 0 }, { - "d": [ - "a", - "b" + "key": 42 + }, + { + "key": -1 + }, + { + "key": 1 + }, + { + "key": 41 + }, + { + "key": 43 + }, + { + "key": 42.0001 + }, + { + "key": 41.9999 + }, + { + "key": 100 + }, + { + "key": "some" + }, + { + "key": "42" + }, + { + "key": null + }, + { + "key": 420 + }, + { + "key": "" + }, + { + "key": {} + }, + { + "key": [] + }, + { + "key": [ + 42 ] }, { - "d": true + "key": { + "key": 42 + } + }, + { + "key": { + "some": 42 + } + }, + { + "some": "value" } ] ``` Error: ``` - Object reference not set to an instance of an object. + Accessed JArray values with invalid key value: "valueOf". Int32 array index expected. ``` - [ ] `$[*].bookmarks[?(@.page == 45)]^^^` @@ -1279,61 +1628,6 @@ The following queries provide results that do not match those of other implement [] ``` -- [ ] `$[?(@.name=~/hello.*/)]` - Input: - ``` - [ - { - "name": "hullo world" - }, - { - "name": "hello world" - }, - { - "name": "yes hello world" - }, - { - "name": "HELLO WORLD" - }, - { - "name": "good bye" - } - ] - ``` - Error: - ``` - Object of type 'System.Double' cannot be converted to type 'Newtonsoft.Json.Linq.JToken'. - ``` - -- [ ] `$[?(@.name=~/@.pattern/)]` - Input: - ``` - [ - { - "name": "hullo world" - }, - { - "name": "hello world" - }, - { - "name": "yes hello world" - }, - { - "name": "HELLO WORLD" - }, - { - "name": "good bye" - }, - { - "pattern": "hello.*" - } - ] - ``` - Error: - ``` - Object of type 'System.Double' cannot be converted to type 'Newtonsoft.Json.Linq.JToken'. - ``` - - [ ] `$[?(@[*]>=4)]` Input: ``` @@ -1463,9 +1757,71 @@ The following queries provide results that do not match those of other implement ``` NOT_SUPPORTED ``` - Error: + Actual output: ``` - Object of type 'System.Double' cannot be converted to type 'Newtonsoft.Json.Linq.JToken'. + [ + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0 + }, + { + "key": 42.0, + "some": "value" + } + ] ``` - [ ] `$[?(@.a[?(@.price>10)])]` @@ -1544,7 +1900,7 @@ The following queries provide results that do not match those of other implement ``` Error: ``` - a is null + Cannot read property 'b' of undefined ``` - [ ] `$[?(@.key)]` @@ -1623,7 +1979,7 @@ The following queries provide results that do not match those of other implement ``` Error: ``` - Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'System.IConvertible'. + Accessed JArray values with invalid key value: "id". Int32 array index expected. ``` - [ ] `$[?(@..child)]` @@ -1886,7 +2242,9 @@ The following queries provide results that do not match those of other implement ``` Actual output: ``` - [] + [ + "fifth" + ] ``` - [ ] `$[?(@.key<3),?(@.key>6)]` diff --git a/docs/index.html b/docs/index.html index 57610f43d..3a611148a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -21945,7 +21945,7 @@

Explanation

- +e @@ -22096,7 +22096,7 @@

Explanation

- +e @@ -22546,7 +22546,7 @@

Explanation

- +e @@ -22696,7 +22696,7 @@

Explanation

- +e @@ -22996,7 +22996,7 @@

Explanation

- +e @@ -23146,7 +23146,7 @@

Explanation

- +e @@ -23746,7 +23746,7 @@

Explanation

- + @@ -23896,7 +23896,7 @@

Explanation

- + @@ -25246,7 +25246,7 @@

Explanation

- +e @@ -25996,7 +25996,7 @@

Explanation

-e + @@ -26596,7 +26596,7 @@

Explanation

-e + @@ -26896,7 +26896,7 @@

Explanation

- +e @@ -27946,7 +27946,7 @@

Explanation

-e + @@ -28096,7 +28096,7 @@

Explanation

- +e @@ -28996,7 +28996,7 @@

Explanation

- +e @@ -30496,7 +30496,7 @@

Explanation

- + @@ -31396,7 +31396,7 @@

Explanation

-e + @@ -31996,7 +31996,7 @@

Explanation

- +e @@ -32146,7 +32146,7 @@

Explanation

-e + @@ -32446,7 +32446,7 @@

Explanation

-e + @@ -32596,7 +32596,7 @@

Explanation

-e + @@ -33046,7 +33046,7 @@

Explanation

-e + diff --git a/docs/results/filter_expression_after_dot_notation_with_wildcard_after_recursive_descent.html b/docs/results/filter_expression_after_dot_notation_with_wildcard_after_recursive_descent.html index b5c5fb38e..c42617dc0 100644 --- a/docs/results/filter_expression_after_dot_notation_with_wildcard_after_recursive_descent.html +++ b/docs/results/filter_expression_after_dot_notation_with_wildcard_after_recursive_descent.html @@ -1055,26 +1055,6 @@

] -

-dotNET (JsonPathLib) -

- -
[
-  {
-    "id": 3,
-    "name": "another"
-  },
-  {
-    "id": 4,
-    "name": "more"
-  },
-  {
-    "id": 5,
-    "name": "next to last"
-  }
-]
-
-

dotNET (Manatee.Json)

@@ -1128,6 +1108,13 @@

non-safe evaluation, died at main.pl line 11.
 
+

+dotNET (JsonPathLib) +

+ +
Accessed JArray values with invalid key value: "id". Int32 array index expected.
+
+

Footnotes