From e026e82f65376d46f88114afbf9bb0a056b04ae7 Mon Sep 17 00:00:00 2001 From: Alex Groleau Date: Tue, 23 Jun 2026 20:17:03 -0400 Subject: [PATCH] test(jspg): rename items fixture to array and resolve unused HashMap warning - Rename fixtures/items.json to fixtures/array.json to better reflect array testing constraints. - Update reference paths in src/tests/fixtures.rs and across other fixture JSON files. - Remove unused HashMap import in src/validator/rules/dict.rs to resolve the compiler warning. --- fixtures/{items.json => array.json} | 452 ++++++++++---------------- fixtures/booleanSchema.json | 10 - fixtures/const.json | 100 ------ fixtures/contains.json | 46 +-- fixtures/database.json | 8 +- fixtures/dependencies.json | 12 +- fixtures/dynamicType.json | 4 +- fixtures/enum.json | 60 ---- fixtures/exclusiveMaximum.json | 8 +- fixtures/exclusiveMinimum.json | 4 +- fixtures/format.json | 472 ++++++++++++++-------------- fixtures/maxContains.json | 12 +- fixtures/maxItems.json | 12 +- fixtures/maximum.json | 4 +- fixtures/merge.json | 4 +- fixtures/minContains.json | 36 +-- fixtures/minItems.json | 8 +- fixtures/minLength.json | 8 +- fixtures/minProperties.json | 4 +- fixtures/minimum.json | 4 +- fixtures/multipleOf.json | 4 +- fixtures/not.json | 20 -- fixtures/pattern.json | 3 +- fixtures/properties.json | 10 - fixtures/propertyNames.json | 11 +- fixtures/traits.json | 4 +- src/tests/fixtures.rs | 240 +++++++------- src/validator/rules/dict.rs | 2 +- 28 files changed, 604 insertions(+), 958 deletions(-) rename fixtures/{items.json => array.json} (70%) diff --git a/fixtures/items.json b/fixtures/array.json similarity index 70% rename from fixtures/items.json rename to fixtures/array.json index 32ab0ba..f888a3e 100644 --- a/fixtures/items.json +++ b/fixtures/array.json @@ -1,12 +1,147 @@ [ + { + "description": "array type without items allows any items", + "database": { + "types": [ + { + "name": "array_0_0", + "schemas": { + "array_0_0": { + "type": "array" + } + } + } + ] + }, + "tests": [ + { + "description": "empty array is valid", + "data": [], + "schema_id": "array_0_0", + "action": "validate", + "expect": { + "success": true + } + }, + { + "description": "array with items is valid", + "data": [ + 1, + "foo" + ], + "schema_id": "array_0_0", + "action": "validate", + "expect": { + "success": true + } + }, + { + "description": "array with arbitrary objects is valid since items is not constrained", + "data": [ + { + "extra_prop": 1 + } + ], + "schema_id": "array_0_0", + "action": "validate", + "expect": { + "success": true + } + } + ] + }, + { + "description": "items with boolean schema (true)", + "database": { + "types": [ + { + "name": "array_1_0", + "schemas": { + "array_1_0": { + "items": true + } + } + } + ] + }, + "tests": [ + { + "description": "any array is valid", + "data": [ + 1, + "foo", + true + ], + "schema_id": "array_1_0", + "action": "validate", + "expect": { + "success": true + } + } + ] + }, + { + "description": "items with boolean schema (false)", + "database": { + "types": [ + { + "name": "array_2_0", + "schemas": { + "array_2_0": { + "items": false + } + } + } + ] + }, + "tests": [ + { + "description": "empty array is valid", + "data": [], + "schema_id": "array_2_0", + "action": "validate", + "expect": { + "success": true + } + }, + { + "description": "any non-empty array is invalid", + "data": [ + 1, + "foo" + ], + "schema_id": "array_2_0", + "action": "validate", + "expect": { + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "0", + "schema": "array_2_0" + } + }, + { + "code": "FALSE_SCHEMA", + "details": { + "path": "1", + "schema": "array_2_0" + } + } + ] + } + } + ] + }, { "description": "a schema given for items", "database": { "types": [ { - "name": "items_0_0", + "name": "array_3_0", "schemas": { - "items_0_0": { + "array_3_0": { "items": { "type": "integer" } @@ -23,7 +158,7 @@ 2, 3 ], - "schema_id": "items_0_0", + "schema_id": "array_3_0", "action": "validate", "expect": { "success": true @@ -35,7 +170,7 @@ 1, "x" ], - "schema_id": "items_0_0", + "schema_id": "array_3_0", "action": "validate", "expect": { "success": false, @@ -47,7 +182,7 @@ }, "details": { "path": "1", - "schema": "items_0_0" + "schema": "array_3_0" } } ] @@ -58,7 +193,7 @@ "data": { "foo": "bar" }, - "schema_id": "items_0_0", + "schema_id": "array_3_0", "action": "validate", "expect": { "success": false, @@ -70,7 +205,7 @@ }, "details": { "path": "foo", - "schema": "items_0_0" + "schema": "array_3_0" } } ] @@ -82,7 +217,7 @@ "0": "invalid", "length": 1 }, - "schema_id": "items_0_0", + "schema_id": "array_3_0", "action": "validate", "expect": { "success": false, @@ -94,7 +229,7 @@ }, "details": { "path": "0", - "schema": "items_0_0" + "schema": "array_3_0" } }, { @@ -104,108 +239,16 @@ }, "details": { "path": "length", - "schema": "items_0_0" - } - } - ] - } - } - ] - }, - { - "description": "items with boolean schema (true)", - "database": { - "types": [ - { - "name": "items_1_0", - "schemas": { - "items_1_0": { - "items": true - } - } - } - ] - }, - "tests": [ - { - "description": "any array is valid", - "data": [ - 1, - "foo", - true - ], - "schema_id": "items_1_0", - "action": "validate", - "expect": { - "success": true - } - }, - { - "description": "empty array is valid", - "data": [], - "schema_id": "items_1_0", - "action": "validate", - "expect": { - "success": true - } - } - ] - }, - { - "description": "items with boolean schema (false)", - "database": { - "types": [ - { - "name": "items_2_0", - "schemas": { - "items_2_0": { - "items": false - } - } - } - ] - }, - "tests": [ - { - "description": "any non-empty array is invalid", - "data": [ - 1, - "foo", - true - ], - "schema_id": "items_2_0", - "action": "validate", - "expect": { - "success": false, - "errors": [ - { - "code": "FALSE_SCHEMA", - "details": { - "path": "0", - "schema": "items_2_0" - } - }, - { - "code": "FALSE_SCHEMA", - "details": { - "path": "1", - "schema": "items_2_0" - } - }, - { - "code": "FALSE_SCHEMA", - "details": { - "path": "2", - "schema": "items_2_0" + "schema": "array_3_0" } } ] } }, { - "description": "empty array is valid", - "data": [], - "schema_id": "items_2_0", + "description": "primitive strings are valid since items is ignored on primitives", + "data": "hello", + "schema_id": "array_3_0", "action": "validate", "expect": { "success": true @@ -218,9 +261,9 @@ "database": { "types": [ { - "name": "items_4_0", + "name": "array_4_0", "schemas": { - "items_4_0": { + "array_4_0": { "type": "array", "items": { "type": "array", @@ -272,7 +315,7 @@ ] ] ], - "schema_id": "items_4_0", + "schema_id": "array_4_0", "action": "validate", "expect": { "success": true @@ -310,7 +353,7 @@ ] ] ], - "schema_id": "items_4_0", + "schema_id": "array_4_0", "action": "validate", "expect": { "success": false, @@ -322,7 +365,7 @@ }, "details": { "path": "0/0/0/0", - "schema": "items_4_0" + "schema": "array_4_0" } } ] @@ -354,7 +397,7 @@ ] ] ], - "schema_id": "items_4_0", + "schema_id": "array_4_0", "action": "validate", "expect": { "success": false, @@ -366,7 +409,7 @@ }, "details": { "path": "0/0/0", - "schema": "items_4_0" + "schema": "array_4_0" } }, { @@ -376,7 +419,7 @@ }, "details": { "path": "0/1/0", - "schema": "items_4_0" + "schema": "array_4_0" } }, { @@ -386,7 +429,7 @@ }, "details": { "path": "0/2/0", - "schema": "items_4_0" + "schema": "array_4_0" } }, { @@ -396,7 +439,7 @@ }, "details": { "path": "1/0/0", - "schema": "items_4_0" + "schema": "array_4_0" } }, { @@ -406,7 +449,7 @@ }, "details": { "path": "1/1/0", - "schema": "items_4_0" + "schema": "array_4_0" } }, { @@ -416,7 +459,7 @@ }, "details": { "path": "1/2/0", - "schema": "items_4_0" + "schema": "array_4_0" } } ] @@ -429,9 +472,9 @@ "database": { "types": [ { - "name": "items_9_0", + "name": "array_5_0", "schemas": { - "items_9_0": { + "array_5_0": { "items": { "type": "null" } @@ -446,140 +489,7 @@ "data": [ null ], - "schema_id": "items_9_0", - "action": "validate", - "expect": { - "success": true - } - } - ] - }, - { - "description": "extensible: true allows extra items (when items is false)", - "database": { - "types": [ - { - "name": "items_10_0", - "schemas": { - "items_10_0": { - "items": false, - "extensible": true - } - } - } - ] - }, - "tests": [ - { - "description": "extra item is valid", - "data": [ - 1 - ], - "schema_id": "items_10_0", - "action": "validate", - "expect": { - "success": false, - "errors": [ - { - "code": "FALSE_SCHEMA", - "details": { - "path": "0", - "schema": "items_10_0" - } - } - ] - } - } - ] - }, - { - "description": "extensible: true allows extra properties for items", - "database": { - "types": [ - { - "name": "items_11_0", - "schemas": { - "items_11_0": { - "items": { - "minimum": 5 - }, - "extensible": true - } - } - } - ] - }, - "tests": [ - { - "description": "valid item is valid", - "data": [ - 5, - 6 - ], - "schema_id": "items_11_0", - "action": "validate", - "expect": { - "success": true - } - }, - { - "description": "invalid item (less than min) is invalid even with extensible: true", - "data": [ - 4 - ], - "schema_id": "items_11_0", - "action": "validate", - "expect": { - "success": false, - "errors": [ - { - "code": "MINIMUM_VIOLATED", - "values": { - "limit": "5", - "value": "4" - }, - "details": { - "path": "0", - "schema": "items_11_0" - } - } - ] - } - } - ] - }, - { - "description": "array: simple extensible array", - "database": { - "types": [ - { - "name": "items_12_0", - "schemas": { - "items_12_0": { - "type": "array", - "extensible": true - } - } - } - ] - }, - "tests": [ - { - "description": "empty array is valid", - "data": [], - "schema_id": "items_12_0", - "action": "validate", - "expect": { - "success": true - } - }, - { - "description": "array with items is valid (extensible)", - "data": [ - 1, - "foo" - ], - "schema_id": "items_12_0", + "schema_id": "array_5_0", "action": "validate", "expect": { "success": true @@ -592,9 +502,9 @@ "database": { "types": [ { - "name": "items_14_0", + "name": "array_6_0", "schemas": { - "items_14_0": { + "array_6_0": { "type": "array", "items": { "extensible": true @@ -605,15 +515,6 @@ ] }, "tests": [ - { - "description": "empty array is valid", - "data": [], - "schema_id": "items_14_0", - "action": "validate", - "expect": { - "success": true - } - }, { "description": "array with items is valid (items explicitly allowed to be anything extensible)", "data": [ @@ -621,7 +522,7 @@ "foo", {} ], - "schema_id": "items_14_0", + "schema_id": "array_6_0", "action": "validate", "expect": { "success": true @@ -634,9 +535,9 @@ "database": { "types": [ { - "name": "items_15_0", + "name": "array_7_0", "schemas": { - "items_15_0": { + "array_7_0": { "type": "array", "items": { "type": "object", @@ -648,23 +549,12 @@ ] }, "tests": [ - { - "description": "empty array is valid (empty objects)", - "data": [ - {} - ], - "schema_id": "items_15_0", - "action": "validate", - "expect": { - "success": true - } - }, { "description": "array with strict object items is valid", "data": [ {} ], - "schema_id": "items_15_0", + "schema_id": "array_7_0", "action": "validate", "expect": { "success": true @@ -677,7 +567,7 @@ "extra": 1 } ], - "schema_id": "items_15_0", + "schema_id": "array_7_0", "action": "validate", "expect": { "success": false, @@ -689,7 +579,7 @@ }, "details": { "path": "0/extra", - "schema": "items_15_0" + "schema": "array_7_0" } } ] diff --git a/fixtures/booleanSchema.json b/fixtures/booleanSchema.json index 95abc79..22214d8 100644 --- a/fixtures/booleanSchema.json +++ b/fixtures/booleanSchema.json @@ -268,16 +268,6 @@ "path": "", "schema": "booleanSchema_1_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "booleanSchema_1_0" - } } ] } diff --git a/fixtures/const.json b/fixtures/const.json index bedf326..07e0239 100644 --- a/fixtures/const.json +++ b/fixtures/const.json @@ -156,26 +156,6 @@ "path": "", "schema": "const_1_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "const_1_0" - } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "1" - }, - "details": { - "path": "1", - "schema": "const_1_0" - } } ] } @@ -233,16 +213,6 @@ "path": "", "schema": "const_2_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "const_2_0" - } } ] } @@ -268,36 +238,6 @@ "path": "", "schema": "const_2_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "const_2_0" - } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "1" - }, - "details": { - "path": "1", - "schema": "const_2_0" - } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "2" - }, - "details": { - "path": "2", - "schema": "const_2_0" - } } ] } @@ -534,16 +474,6 @@ "path": "", "schema": "const_6_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "const_6_0" - } } ] } @@ -567,16 +497,6 @@ "path": "", "schema": "const_6_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "const_6_0" - } } ] } @@ -630,16 +550,6 @@ "path": "", "schema": "const_7_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "const_7_0" - } } ] } @@ -663,16 +573,6 @@ "path": "", "schema": "const_7_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "const_7_0" - } } ] } diff --git a/fixtures/contains.json b/fixtures/contains.json index 70f5c86..0125fe0 100644 --- a/fixtures/contains.json +++ b/fixtures/contains.json @@ -177,8 +177,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "count": "0", - "limit": "1" + "limit": "1", + "count": "0" }, "details": { "path": "", @@ -227,8 +227,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "limit": "1", - "count": "0" + "count": "0", + "limit": "1" }, "details": { "path": "", @@ -275,16 +275,6 @@ "path": "", "schema": "contains_3_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "contains_3_0" - } } ] } @@ -383,8 +373,8 @@ { "code": "MULTIPLE_OF_VIOLATED", "values": { - "value": "3", - "multiple_of": "2" + "multiple_of": "2", + "value": "3" }, "details": { "path": "0", @@ -394,8 +384,8 @@ { "code": "MULTIPLE_OF_VIOLATED", "values": { - "multiple_of": "2", - "value": "9" + "value": "9", + "multiple_of": "2" }, "details": { "path": "2", @@ -431,8 +421,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "limit": "1", - "count": "0" + "count": "0", + "limit": "1" }, "details": { "path": "", @@ -599,7 +589,7 @@ }, "tests": [ { - "description": "extra items cause failure", + "description": "extra items do not cause failure", "data": [ 1, 2 @@ -607,19 +597,7 @@ "schema_id": "contains_8_0", "action": "validate", "expect": { - "success": false, - "errors": [ - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "1" - }, - "details": { - "path": "1", - "schema": "contains_8_0" - } - } - ] + "success": true } }, { diff --git a/fixtures/database.json b/fixtures/database.json index e43b47b..03a9184 100644 --- a/fixtures/database.json +++ b/fixtures/database.json @@ -151,9 +151,9 @@ { "code": "EDGE_MISSING", "values": { - "child_type": "child", "property_name": "children", - "parent_type": "parent" + "parent_type": "parent", + "child_type": "child" }, "details": { "path": "full.parent/children", @@ -390,9 +390,9 @@ { "code": "AMBIGUOUS_TYPE_RELATIONS", "values": { - "parent_type": "actor", + "property_name": "ambiguous_edge", "child_type": "junction", - "property_name": "ambiguous_edge" + "parent_type": "actor" }, "details": { "path": "full.actor/ambiguous_edge", diff --git a/fixtures/dependencies.json b/fixtures/dependencies.json index b647169..a52022f 100644 --- a/fixtures/dependencies.json +++ b/fixtures/dependencies.json @@ -227,8 +227,8 @@ { "code": "DEPENDENCY_MISSING", "values": { - "property_name": "quux", - "required_property": "bar" + "required_property": "bar", + "property_name": "quux" }, "details": { "path": "", @@ -276,8 +276,8 @@ { "code": "DEPENDENCY_MISSING", "values": { - "property_name": "quux", - "required_property": "foo" + "required_property": "foo", + "property_name": "quux" }, "details": { "path": "", @@ -287,8 +287,8 @@ { "code": "DEPENDENCY_MISSING", "values": { - "property_name": "quux", - "required_property": "bar" + "required_property": "bar", + "property_name": "quux" }, "details": { "path": "", diff --git a/fixtures/dynamicType.json b/fixtures/dynamicType.json index 877d2d8..0c1adec 100644 --- a/fixtures/dynamicType.json +++ b/fixtures/dynamicType.json @@ -164,8 +164,8 @@ { "code": "DYNAMIC_TYPE_RESOLUTION_FAILED", "values": { - "discriminator": "kind", - "pointer": "$kind.filter" + "pointer": "$kind.filter", + "discriminator": "kind" }, "details": { "path": "filter", diff --git a/fixtures/enum.json b/fixtures/enum.json index 4993fba..8b1baf5 100644 --- a/fixtures/enum.json +++ b/fixtures/enum.json @@ -560,16 +560,6 @@ "path": "", "schema": "enum_6_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "enum_6_0" - } } ] } @@ -593,16 +583,6 @@ "path": "", "schema": "enum_6_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "enum_6_0" - } } ] } @@ -728,16 +708,6 @@ "path": "", "schema": "enum_8_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "enum_8_0" - } } ] } @@ -761,16 +731,6 @@ "path": "", "schema": "enum_8_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "enum_8_0" - } } ] } @@ -873,16 +833,6 @@ "path": "", "schema": "enum_10_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "enum_10_0" - } } ] } @@ -1007,16 +957,6 @@ "path": "", "schema": "enum_12_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "enum_12_0" - } } ] } diff --git a/fixtures/exclusiveMaximum.json b/fixtures/exclusiveMaximum.json index 6ec3f77..eff6122 100644 --- a/fixtures/exclusiveMaximum.json +++ b/fixtures/exclusiveMaximum.json @@ -34,8 +34,8 @@ { "code": "EXCLUSIVE_MAXIMUM_VIOLATED", "values": { - "value": "3", - "limit": "3" + "limit": "3", + "value": "3" }, "details": { "path": "", @@ -56,8 +56,8 @@ { "code": "EXCLUSIVE_MAXIMUM_VIOLATED", "values": { - "value": "3.5", - "limit": "3" + "limit": "3", + "value": "3.5" }, "details": { "path": "", diff --git a/fixtures/exclusiveMinimum.json b/fixtures/exclusiveMinimum.json index 5e81e15..fc49d5e 100644 --- a/fixtures/exclusiveMinimum.json +++ b/fixtures/exclusiveMinimum.json @@ -56,8 +56,8 @@ { "code": "EXCLUSIVE_MINIMUM_VIOLATED", "values": { - "limit": "1.1", - "value": "0.6" + "value": "0.6", + "limit": "1.1" }, "details": { "path": "", diff --git a/fixtures/format.json b/fixtures/format.json index 9e74d3f..44a202d 100644 --- a/fixtures/format.json +++ b/fixtures/format.json @@ -318,8 +318,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "11th character must be t or T", - "format": "date-time" + "format": "date-time", + "error": "11th character must be t or T" }, "details": { "path": "", @@ -406,8 +406,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "date-time", - "error": "11th character must be t or T" + "error": "11th character must be t or T", + "format": "date-time" }, "details": { "path": "", @@ -517,8 +517,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "32 days in month", - "format": "date" + "format": "date", + "error": "32 days in month" }, "details": { "path": "", @@ -672,8 +672,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "32 days in month", - "format": "date" + "format": "date", + "error": "32 days in month" }, "details": { "path": "", @@ -703,8 +703,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "month has 30 days only", - "format": "date" + "format": "date", + "error": "month has 30 days only" }, "details": { "path": "", @@ -734,8 +734,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "date", - "error": "32 days in month" + "error": "32 days in month", + "format": "date" }, "details": { "path": "", @@ -765,8 +765,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "32 days in month", - "format": "date" + "format": "date", + "error": "32 days in month" }, "details": { "path": "", @@ -889,8 +889,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "32 days in month", - "format": "date" + "format": "date", + "error": "32 days in month" }, "details": { "path": "", @@ -911,8 +911,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "date", - "error": "13 months in year" + "error": "13 months in year", + "format": "date" }, "details": { "path": "", @@ -933,8 +933,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "missing hyphen in correct place", - "format": "date" + "format": "date", + "error": "missing hyphen in correct place" }, "details": { "path": "", @@ -1043,8 +1043,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "month has 30 days only", - "format": "date" + "format": "date", + "error": "month has 30 days only" }, "details": { "path": "", @@ -1206,8 +1206,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "must be 10 characters long", - "format": "date" + "format": "date", + "error": "must be 10 characters long" }, "details": { "path": "", @@ -1374,8 +1374,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "no time elements", - "format": "duration" + "format": "duration", + "error": "no time elements" }, "details": { "path": "", @@ -1396,8 +1396,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "duration", - "error": "no time elements" + "error": "no time elements", + "format": "duration" }, "details": { "path": "", @@ -1418,8 +1418,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "unit Y out of order", - "format": "duration" + "format": "duration", + "error": "unit Y out of order" }, "details": { "path": "", @@ -1440,8 +1440,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid unit H", - "format": "duration" + "format": "duration", + "error": "invalid unit H" }, "details": { "path": "", @@ -1462,8 +1462,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid unit S", - "format": "duration" + "format": "duration", + "error": "invalid unit S" }, "details": { "path": "", @@ -1556,8 +1556,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "duration", - "error": "invalid week" + "error": "invalid week", + "format": "duration" }, "details": { "path": "", @@ -1578,8 +1578,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "duration", - "error": "missing number" + "error": "missing number", + "format": "duration" }, "details": { "path": "", @@ -1728,8 +1728,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "email", - "error": "missing @" + "error": "missing @", + "format": "email" }, "details": { "path": "", @@ -1844,8 +1844,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "ends with dot", - "format": "email" + "format": "email", + "error": "ends with dot" }, "details": { "path": "", @@ -1897,8 +1897,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "email", - "error": "invalid domain: invalid character '='" + "error": "invalid domain: invalid character '='", + "format": "email" }, "details": { "path": "", @@ -2110,8 +2110,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "hostname", - "error": "label must be 1 to 63 characters long" + "error": "label must be 1 to 63 characters long", + "format": "hostname" }, "details": { "path": "", @@ -2176,8 +2176,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid character '.'", - "format": "hostname" + "format": "hostname", + "error": "invalid character '.'" }, "details": { "path": "", @@ -2207,8 +2207,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "label starts with hyphen", - "format": "hostname" + "format": "hostname", + "error": "label starts with hyphen" }, "details": { "path": "", @@ -2274,8 +2274,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "hostname", - "error": "invalid character '_'" + "error": "invalid character '_'", + "format": "hostname" }, "details": { "path": "", @@ -2367,8 +2367,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "hostname", - "error": "invalid punycode" + "error": "invalid punycode", + "format": "hostname" }, "details": { "path": "", @@ -2421,8 +2421,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid punycode", - "format": "hostname" + "format": "hostname", + "error": "invalid punycode" }, "details": { "path": "", @@ -2467,8 +2467,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "hostname", - "error": "invalid punycode" + "error": "invalid punycode", + "format": "hostname" }, "details": { "path": "", @@ -2602,8 +2602,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid punycode/IDN: MIDDLE DOT is allowed between 'l' characters only", - "format": "hostname" + "format": "hostname", + "error": "invalid punycode/IDN: MIDDLE DOT is allowed between 'l' characters only" }, "details": { "path": "", @@ -2625,8 +2625,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid punycode/IDN: MIDDLE DOT is allowed between 'l' characters only", - "format": "hostname" + "format": "hostname", + "error": "invalid punycode/IDN: MIDDLE DOT is allowed between 'l' characters only" }, "details": { "path": "", @@ -2658,8 +2658,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid punycode/IDN: Greek KERAIA must be followed by Greek character", - "format": "hostname" + "format": "hostname", + "error": "invalid punycode/IDN: Greek KERAIA must be followed by Greek character" }, "details": { "path": "", @@ -2793,8 +2793,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid punycode/IDN: Hebrew GERESH must be preceded by Hebrew character", - "format": "hostname" + "format": "hostname", + "error": "invalid punycode/IDN: Hebrew GERESH must be preceded by Hebrew character" }, "details": { "path": "", @@ -2902,8 +2902,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid punycode", - "format": "hostname" + "format": "hostname", + "error": "invalid punycode" }, "details": { "path": "", @@ -2945,8 +2945,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "hostname", - "error": "invalid punycode" + "error": "invalid punycode", + "format": "hostname" }, "details": { "path": "", @@ -2968,8 +2968,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "hostname", - "error": "invalid punycode" + "error": "invalid punycode", + "format": "hostname" }, "details": { "path": "", @@ -3100,8 +3100,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "idn-email", - "error": "missing @" + "error": "missing @", + "format": "idn-email" }, "details": { "path": "", @@ -3255,8 +3255,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "contains disallowed character", - "format": "idn-hostname" + "format": "idn-hostname", + "error": "contains disallowed character" }, "details": { "path": "", @@ -3379,8 +3379,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "idn-hostname", - "error": "idna error: Errors" + "error": "idna error: Errors", + "format": "idn-hostname" }, "details": { "path": "", @@ -3425,8 +3425,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "idn-hostname", - "error": "idna error: Errors" + "error": "idna error: Errors", + "format": "idn-hostname" }, "details": { "path": "", @@ -3448,8 +3448,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "idn-hostname", - "error": "idna error: Errors" + "error": "idna error: Errors", + "format": "idn-hostname" }, "details": { "path": "", @@ -3471,8 +3471,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "idna error: Errors", - "format": "idn-hostname" + "format": "idn-hostname", + "error": "idna error: Errors" }, "details": { "path": "", @@ -3494,8 +3494,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "idna error: Errors", - "format": "idn-hostname" + "format": "idn-hostname", + "error": "idna error: Errors" }, "details": { "path": "", @@ -3537,8 +3537,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "contains disallowed character", - "format": "idn-hostname" + "format": "idn-hostname", + "error": "contains disallowed character" }, "details": { "path": "", @@ -3560,8 +3560,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "idn-hostname", - "error": "contains disallowed character" + "error": "contains disallowed character", + "format": "idn-hostname" }, "details": { "path": "", @@ -3606,8 +3606,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "MIDDLE DOT is allowed between 'l' characters only", - "format": "idn-hostname" + "format": "idn-hostname", + "error": "MIDDLE DOT is allowed between 'l' characters only" }, "details": { "path": "", @@ -3708,8 +3708,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "idn-hostname", - "error": "Greek KERAIA must be followed by Greek character" + "error": "Greek KERAIA must be followed by Greek character", + "format": "idn-hostname" }, "details": { "path": "", @@ -3764,8 +3764,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "idn-hostname", - "error": "Hebrew GERESH must be preceded by Hebrew character" + "error": "Hebrew GERESH must be preceded by Hebrew character", + "format": "idn-hostname" }, "details": { "path": "", @@ -3797,8 +3797,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "idna error: Errors", - "format": "idn-hostname" + "format": "idn-hostname", + "error": "idna error: Errors" }, "details": { "path": "", @@ -3820,8 +3820,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "idn-hostname", - "error": "Hebrew GERESH must be preceded by Hebrew character" + "error": "Hebrew GERESH must be preceded by Hebrew character", + "format": "idn-hostname" }, "details": { "path": "", @@ -3853,8 +3853,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "KATAKANA MIDDLE DOT must be with Hiragana, Katakana, or Han", - "format": "idn-hostname" + "format": "idn-hostname", + "error": "KATAKANA MIDDLE DOT must be with Hiragana, Katakana, or Han" }, "details": { "path": "", @@ -3929,8 +3929,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "idn-hostname", - "error": "idna error: Errors" + "error": "idna error: Errors", + "format": "idn-hostname" }, "details": { "path": "", @@ -4168,8 +4168,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "idn-hostname", - "error": "idna error: Errors" + "error": "idna error: Errors", + "format": "idn-hostname" }, "details": { "path": "", @@ -4190,8 +4190,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "idna error: Errors", - "format": "idn-hostname" + "format": "idn-hostname", + "error": "idna error: Errors" }, "details": { "path": "", @@ -4248,8 +4248,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "idna error: Errors", - "format": "idn-hostname" + "format": "idn-hostname", + "error": "idna error: Errors" }, "details": { "path": "", @@ -4292,8 +4292,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "idna error: Errors", - "format": "idn-hostname" + "format": "idn-hostname", + "error": "idna error: Errors" }, "details": { "path": "", @@ -4314,8 +4314,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "idna error: Errors", - "format": "idn-hostname" + "format": "idn-hostname", + "error": "idna error: Errors" }, "details": { "path": "", @@ -4336,8 +4336,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "idna error: Errors", - "format": "idn-hostname" + "format": "idn-hostname", + "error": "idna error: Errors" }, "details": { "path": "", @@ -4358,8 +4358,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "idn-hostname", - "error": "idna error: Errors" + "error": "idna error: Errors", + "format": "idn-hostname" }, "details": { "path": "", @@ -4562,8 +4562,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "ipv4", - "error": "invalid IPv4 address syntax" + "error": "invalid IPv4 address syntax", + "format": "ipv4" }, "details": { "path": "", @@ -4682,8 +4682,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid IPv4 address syntax", - "format": "ipv4" + "format": "ipv4", + "error": "invalid IPv4 address syntax" }, "details": { "path": "", @@ -4704,8 +4704,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid IPv4 address syntax", - "format": "ipv4" + "format": "ipv4", + "error": "invalid IPv4 address syntax" }, "details": { "path": "", @@ -4806,8 +4806,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "ipv6", - "error": "invalid IPv6 address syntax" + "error": "invalid IPv6 address syntax", + "format": "ipv6" }, "details": { "path": "", @@ -4837,8 +4837,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid IPv6 address syntax", - "format": "ipv6" + "format": "ipv6", + "error": "invalid IPv6 address syntax" }, "details": { "path": "", @@ -4881,8 +4881,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid IPv6 address syntax", - "format": "ipv6" + "format": "ipv6", + "error": "invalid IPv6 address syntax" }, "details": { "path": "", @@ -4930,8 +4930,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid IPv6 address syntax", - "format": "ipv6" + "format": "ipv6", + "error": "invalid IPv6 address syntax" }, "details": { "path": "", @@ -4952,8 +4952,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid IPv6 address syntax", - "format": "ipv6" + "format": "ipv6", + "error": "invalid IPv6 address syntax" }, "details": { "path": "", @@ -4974,8 +4974,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "ipv6", - "error": "invalid IPv6 address syntax" + "error": "invalid IPv6 address syntax", + "format": "ipv6" }, "details": { "path": "", @@ -5045,8 +5045,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "ipv6", - "error": "invalid IPv6 address syntax" + "error": "invalid IPv6 address syntax", + "format": "ipv6" }, "details": { "path": "", @@ -5067,8 +5067,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid IPv6 address syntax", - "format": "ipv6" + "format": "ipv6", + "error": "invalid IPv6 address syntax" }, "details": { "path": "", @@ -5098,8 +5098,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid IPv6 address syntax", - "format": "ipv6" + "format": "ipv6", + "error": "invalid IPv6 address syntax" }, "details": { "path": "", @@ -5195,8 +5195,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid IPv6 address syntax", - "format": "ipv6" + "format": "ipv6", + "error": "invalid IPv6 address syntax" }, "details": { "path": "", @@ -5239,8 +5239,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid IPv6 address syntax", - "format": "ipv6" + "format": "ipv6", + "error": "invalid IPv6 address syntax" }, "details": { "path": "", @@ -5261,8 +5261,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "ipv6", - "error": "invalid IPv6 address syntax" + "error": "invalid IPv6 address syntax", + "format": "ipv6" }, "details": { "path": "", @@ -5314,8 +5314,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "ipv6", - "error": "invalid IPv6 address syntax" + "error": "invalid IPv6 address syntax", + "format": "ipv6" }, "details": { "path": "", @@ -5336,8 +5336,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "ipv6", - "error": "invalid IPv6 address syntax" + "error": "invalid IPv6 address syntax", + "format": "ipv6" }, "details": { "path": "", @@ -5358,8 +5358,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "ipv6", - "error": "invalid IPv6 address syntax" + "error": "invalid IPv6 address syntax", + "format": "ipv6" }, "details": { "path": "", @@ -5500,8 +5500,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "contains \\\\", - "format": "iri-reference" + "format": "iri-reference", + "error": "contains \\\\" }, "details": { "path": "", @@ -5700,8 +5700,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "iri", - "error": "relative url" + "error": "relative url", + "format": "iri" }, "details": { "path": "", @@ -5722,8 +5722,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "relative url", - "format": "iri" + "format": "iri", + "error": "relative url" }, "details": { "path": "", @@ -5744,8 +5744,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "iri", - "error": "relative url" + "error": "relative url", + "format": "iri" }, "details": { "path": "", @@ -6061,8 +6061,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "json-pointer", - "error": "not starting with slash" + "error": "not starting with slash", + "format": "json-pointer" }, "details": { "path": "", @@ -6083,8 +6083,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "not starting with slash", - "format": "json-pointer" + "format": "json-pointer", + "error": "not starting with slash" }, "details": { "path": "", @@ -6149,8 +6149,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "json-pointer", - "error": "~ must be followed by 0 or 1" + "error": "~ must be followed by 0 or 1", + "format": "json-pointer" }, "details": { "path": "", @@ -6193,8 +6193,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "json-pointer", - "error": "~ must be followed by 0 or 1" + "error": "~ must be followed by 0 or 1", + "format": "json-pointer" }, "details": { "path": "", @@ -6237,8 +6237,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "json-pointer", - "error": "not starting with slash" + "error": "not starting with slash", + "format": "json-pointer" }, "details": { "path": "", @@ -6499,8 +6499,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "relative-json-pointer", - "error": "must start with non-negative integer" + "error": "must start with non-negative integer", + "format": "relative-json-pointer" }, "details": { "path": "", @@ -6521,8 +6521,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "must start with non-negative integer", - "format": "relative-json-pointer" + "format": "relative-json-pointer", + "error": "must start with non-negative integer" }, "details": { "path": "", @@ -6543,8 +6543,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid json-pointer element: not starting with slash", - "format": "relative-json-pointer" + "format": "relative-json-pointer", + "error": "invalid json-pointer element: not starting with slash" }, "details": { "path": "", @@ -6565,8 +6565,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "relative-json-pointer", - "error": "starts with zero" + "error": "starts with zero", + "format": "relative-json-pointer" }, "details": { "path": "", @@ -6729,8 +6729,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "time", - "error": "less than 9 characters long" + "error": "less than 9 characters long", + "format": "time" }, "details": { "path": "", @@ -6751,8 +6751,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "missing colon in correct place", - "format": "time" + "format": "time", + "error": "missing colon in correct place" }, "details": { "path": "", @@ -6782,8 +6782,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "invalid leap second", - "format": "time" + "format": "time", + "error": "invalid leap second" }, "details": { "path": "", @@ -7114,8 +7114,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "hour/min/sec out of range", - "format": "time" + "format": "time", + "error": "hour/min/sec out of range" }, "details": { "path": "", @@ -7180,8 +7180,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "time", - "error": "hour/min in offset out of range" + "error": "hour/min in offset out of range", + "format": "time" }, "details": { "path": "", @@ -7224,8 +7224,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "time", - "error": "offset must be 6 characters long" + "error": "offset must be 6 characters long", + "format": "time" }, "details": { "path": "", @@ -7268,8 +7268,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "offset must be 6 characters long", - "format": "time" + "format": "time", + "error": "offset must be 6 characters long" }, "details": { "path": "", @@ -7312,8 +7312,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "time", - "error": "offset must be 6 characters long" + "error": "offset must be 6 characters long", + "format": "time" }, "details": { "path": "", @@ -7378,8 +7378,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "time", - "error": "less than 9 characters long" + "error": "less than 9 characters long", + "format": "time" }, "details": { "path": "", @@ -7600,8 +7600,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "uri-reference", - "error": "unexpected character at index 0" + "error": "unexpected character at index 0", + "format": "uri-reference" }, "details": { "path": "", @@ -7640,8 +7640,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "uri-reference", - "error": "unexpected character at index 5" + "error": "unexpected character at index 5", + "format": "uri-reference" }, "details": { "path": "", @@ -7662,8 +7662,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "uri-reference", - "error": "unexpected character at index 7" + "error": "unexpected character at index 7", + "format": "uri-reference" }, "details": { "path": "", @@ -7786,8 +7786,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "no matching closing brace", - "format": "uri-template" + "format": "uri-template", + "error": "no matching closing brace" }, "details": { "path": "", @@ -8014,8 +8014,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "relative url", - "format": "uri" + "format": "uri", + "error": "relative url" }, "details": { "path": "", @@ -8036,8 +8036,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "uri", - "error": "relative url" + "error": "relative url", + "format": "uri" }, "details": { "path": "", @@ -8058,8 +8058,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "uri", - "error": "unexpected character at index 0" + "error": "unexpected character at index 0", + "format": "uri" }, "details": { "path": "", @@ -8124,8 +8124,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "unexpected character at index 0", - "format": "uri" + "format": "uri", + "error": "unexpected character at index 0" }, "details": { "path": "", @@ -8146,8 +8146,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "unexpected character at index 7", - "format": "uri" + "format": "uri", + "error": "unexpected character at index 7" }, "details": { "path": "", @@ -8168,8 +8168,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "unexpected character at index 9", - "format": "uri" + "format": "uri", + "error": "unexpected character at index 9" }, "details": { "path": "", @@ -8212,8 +8212,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "unexpected character at index 26", - "format": "uri" + "format": "uri", + "error": "unexpected character at index 26" }, "details": { "path": "", @@ -8278,8 +8278,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "uri", - "error": "unexpected character at index 26" + "error": "unexpected character at index 26", + "format": "uri" }, "details": { "path": "", @@ -8300,8 +8300,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "uri", - "error": "unexpected character at index 26" + "error": "unexpected character at index 26", + "format": "uri" }, "details": { "path": "", @@ -8366,8 +8366,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "unexpected character at index 26", - "format": "uri" + "format": "uri", + "error": "unexpected character at index 26" }, "details": { "path": "", @@ -8517,8 +8517,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "uuid", - "error": "element 4 must be 4 characters long" + "error": "element 4 must be 4 characters long", + "format": "uuid" }, "details": { "path": "", @@ -8605,8 +8605,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "uuid", - "error": "element 1 must be 8 characters long" + "error": "element 1 must be 8 characters long", + "format": "uuid" }, "details": { "path": "", @@ -8627,8 +8627,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "element 1 must be 8 characters long", - "format": "uuid" + "format": "uuid", + "error": "element 1 must be 8 characters long" }, "details": { "path": "", @@ -8649,8 +8649,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "error": "element 1 must be 8 characters long", - "format": "uuid" + "format": "uuid", + "error": "element 1 must be 8 characters long" }, "details": { "path": "", @@ -8751,8 +8751,8 @@ { "code": "FORMAT_MISMATCH", "values": { - "format": "period", - "error": "missing slash" + "error": "missing slash", + "format": "period" }, "details": { "path": "", diff --git a/fixtures/maxContains.json b/fixtures/maxContains.json index 05134e5..7bfe516 100644 --- a/fixtures/maxContains.json +++ b/fixtures/maxContains.json @@ -70,8 +70,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "count": "0", - "limit": "1" + "limit": "1", + "count": "0" }, "details": { "path": "", @@ -106,8 +106,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "count": "2", - "limit": "1" + "limit": "1", + "count": "2" }, "details": { "path": "", @@ -284,8 +284,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "count": "4", - "limit": "3" + "limit": "3", + "count": "4" }, "details": { "path": "", diff --git a/fixtures/maxItems.json b/fixtures/maxItems.json index 3025568..e6f7a41 100644 --- a/fixtures/maxItems.json +++ b/fixtures/maxItems.json @@ -52,8 +52,8 @@ { "code": "MAX_ITEMS_VIOLATED", "values": { - "count": "3", - "limit": "2" + "limit": "2", + "count": "3" }, "details": { "path": "", @@ -115,8 +115,8 @@ { "code": "MAX_ITEMS_VIOLATED", "values": { - "limit": "2", - "count": "3" + "count": "3", + "limit": "2" }, "details": { "path": "", @@ -158,8 +158,8 @@ { "code": "MAX_ITEMS_VIOLATED", "values": { - "limit": "2", - "count": "3" + "count": "3", + "limit": "2" }, "details": { "path": "", diff --git a/fixtures/maximum.json b/fixtures/maximum.json index f2e8209..ac5a0a1 100644 --- a/fixtures/maximum.json +++ b/fixtures/maximum.json @@ -43,8 +43,8 @@ { "code": "MAXIMUM_VIOLATED", "values": { - "value": "3.5", - "limit": "3" + "limit": "3", + "value": "3.5" }, "details": { "path": "", diff --git a/fixtures/merge.json b/fixtures/merge.json index 8b448ba..ef9f7b1 100644 --- a/fixtures/merge.json +++ b/fixtures/merge.json @@ -239,8 +239,8 @@ { "code": "DEPENDENCY_MISSING", "values": { - "property_name": "trigger", - "required_property": "base_dep" + "required_property": "base_dep", + "property_name": "trigger" }, "details": { "path": "", diff --git a/fixtures/minContains.json b/fixtures/minContains.json index 4135def..20eb2dd 100644 --- a/fixtures/minContains.json +++ b/fixtures/minContains.json @@ -67,8 +67,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "count": "0", - "limit": "1" + "limit": "1", + "count": "0" }, "details": { "path": "", @@ -91,8 +91,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "count": "0", - "limit": "1" + "limit": "1", + "count": "0" }, "details": { "path": "", @@ -169,8 +169,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "count": "0", - "limit": "2" + "limit": "2", + "count": "0" }, "details": { "path": "", @@ -193,8 +193,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "limit": "2", - "count": "1" + "count": "1", + "limit": "2" }, "details": { "path": "", @@ -301,8 +301,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "limit": "2", - "count": "1" + "count": "1", + "limit": "2" }, "details": { "path": "", @@ -381,8 +381,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "count": "1", - "limit": "2" + "limit": "2", + "count": "1" }, "details": { "path": "", @@ -463,8 +463,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "limit": "3", - "count": "0" + "count": "0", + "limit": "3" }, "details": { "path": "", @@ -513,8 +513,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "limit": "1", - "count": "3" + "count": "3", + "limit": "1" }, "details": { "path": "", @@ -657,8 +657,8 @@ { "code": "CONTAINS_VIOLATED", "values": { - "limit": "1", - "count": "2" + "count": "2", + "limit": "1" }, "details": { "path": "", diff --git a/fixtures/minItems.json b/fixtures/minItems.json index ed5f123..2528639 100644 --- a/fixtures/minItems.json +++ b/fixtures/minItems.json @@ -48,8 +48,8 @@ { "code": "MIN_ITEMS_VIOLATED", "values": { - "count": "0", - "limit": "1" + "limit": "1", + "count": "0" }, "details": { "path": "", @@ -108,8 +108,8 @@ { "code": "MIN_ITEMS_VIOLATED", "values": { - "limit": "1", - "count": "0" + "count": "0", + "limit": "1" }, "details": { "path": "", diff --git a/fixtures/minLength.json b/fixtures/minLength.json index e6eb883..514765d 100644 --- a/fixtures/minLength.json +++ b/fixtures/minLength.json @@ -43,8 +43,8 @@ { "code": "MIN_LENGTH_VIOLATED", "values": { - "count": "1", - "limit": "2" + "limit": "2", + "count": "1" }, "details": { "path": "", @@ -74,8 +74,8 @@ { "code": "MIN_LENGTH_VIOLATED", "values": { - "limit": "2", - "count": "1" + "count": "1", + "limit": "2" }, "details": { "path": "", diff --git a/fixtures/minProperties.json b/fixtures/minProperties.json index 0f91a0d..c4b14ff 100644 --- a/fixtures/minProperties.json +++ b/fixtures/minProperties.json @@ -128,8 +128,8 @@ { "code": "MIN_PROPERTIES_VIOLATED", "values": { - "limit": "1", - "count": "0" + "count": "0", + "limit": "1" }, "details": { "path": "", diff --git a/fixtures/minimum.json b/fixtures/minimum.json index dd1cf63..182ef37 100644 --- a/fixtures/minimum.json +++ b/fixtures/minimum.json @@ -127,8 +127,8 @@ { "code": "MINIMUM_VIOLATED", "values": { - "limit": "-2", - "value": "-2.0001" + "value": "-2.0001", + "limit": "-2" }, "details": { "path": "", diff --git a/fixtures/multipleOf.json b/fixtures/multipleOf.json index b5dd018..2d153d1 100644 --- a/fixtures/multipleOf.json +++ b/fixtures/multipleOf.json @@ -148,8 +148,8 @@ { "code": "MULTIPLE_OF_VIOLATED", "values": { - "multiple_of": "0.0001", - "value": "0.00751" + "value": "0.00751", + "multiple_of": "0.0001" }, "details": { "path": "", diff --git a/fixtures/not.json b/fixtures/not.json index 666b9c5..a5930a3 100644 --- a/fixtures/not.json +++ b/fixtures/not.json @@ -407,16 +407,6 @@ "path": "", "schema": "not_4_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "not_4_0" - } } ] } @@ -610,16 +600,6 @@ "path": "", "schema": "not_5_0" } - }, - { - "code": "STRICT_ITEM_VIOLATION", - "values": { - "index": "0" - }, - "details": { - "path": "0", - "schema": "not_5_0" - } } ] } diff --git a/fixtures/pattern.json b/fixtures/pattern.json index 34ebd37..e200bcb 100644 --- a/fixtures/pattern.json +++ b/fixtures/pattern.json @@ -34,7 +34,8 @@ { "code": "PATTERN_VIOLATED", "values": { - "pattern": "^a*$" + "pattern": "^a*$", + "value": "abc" }, "details": { "path": "", diff --git a/fixtures/properties.json b/fixtures/properties.json index 079d6f3..ceb7b3f 100644 --- a/fixtures/properties.json +++ b/fixtures/properties.json @@ -489,16 +489,6 @@ "path": "constructor", "schema": "properties_4_0" } - }, - { - "code": "STRICT_PROPERTY_VIOLATION", - "values": { - "property_name": "length" - }, - "details": { - "path": "constructor/length", - "schema": "properties_4_0" - } } ] } diff --git a/fixtures/propertyNames.json b/fixtures/propertyNames.json index f699a64..1b96a34 100644 --- a/fixtures/propertyNames.json +++ b/fixtures/propertyNames.json @@ -43,8 +43,8 @@ { "code": "MAX_LENGTH_VIOLATED", "values": { - "count": "6", - "limit": "3" + "limit": "3", + "count": "6" }, "details": { "path": "", @@ -141,7 +141,8 @@ { "code": "PATTERN_VIOLATED", "values": { - "pattern": "^a+$" + "pattern": "^a+$", + "value": "aaA" }, "details": { "path": "", @@ -430,8 +431,8 @@ { "code": "MAX_LENGTH_VIOLATED", "values": { - "limit": "3", - "count": "6" + "count": "6", + "limit": "3" }, "details": { "path": "", diff --git a/fixtures/traits.json b/fixtures/traits.json index d274fae..109b01b 100644 --- a/fixtures/traits.json +++ b/fixtures/traits.json @@ -139,8 +139,8 @@ { "code": "MAX_LENGTH_VIOLATED", "values": { - "limit": "5", - "count": "26" + "count": "26", + "limit": "5" }, "details": { "path": "email", diff --git a/src/tests/fixtures.rs b/src/tests/fixtures.rs index a1b7d52..b22d10c 100644 --- a/src/tests/fixtures.rs +++ b/src/tests/fixtures.rs @@ -1697,138 +1697,6 @@ fn test_not_11_1() { crate::tests::runner::run_test_case(&path, 11, 1).unwrap(); } -#[test] -fn test_items_0_0() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 0, 0).unwrap(); -} - -#[test] -fn test_items_0_1() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 0, 1).unwrap(); -} - -#[test] -fn test_items_0_2() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 0, 2).unwrap(); -} - -#[test] -fn test_items_0_3() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 0, 3).unwrap(); -} - -#[test] -fn test_items_1_0() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 1, 0).unwrap(); -} - -#[test] -fn test_items_1_1() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 1, 1).unwrap(); -} - -#[test] -fn test_items_2_0() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 2, 0).unwrap(); -} - -#[test] -fn test_items_2_1() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 2, 1).unwrap(); -} - -#[test] -fn test_items_3_0() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 3, 0).unwrap(); -} - -#[test] -fn test_items_3_1() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 3, 1).unwrap(); -} - -#[test] -fn test_items_3_2() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 3, 2).unwrap(); -} - -#[test] -fn test_items_4_0() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 4, 0).unwrap(); -} - -#[test] -fn test_items_5_0() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 5, 0).unwrap(); -} - -#[test] -fn test_items_6_0() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 6, 0).unwrap(); -} - -#[test] -fn test_items_6_1() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 6, 1).unwrap(); -} - -#[test] -fn test_items_7_0() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 7, 0).unwrap(); -} - -#[test] -fn test_items_7_1() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 7, 1).unwrap(); -} - -#[test] -fn test_items_8_0() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 8, 0).unwrap(); -} - -#[test] -fn test_items_8_1() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 8, 1).unwrap(); -} - -#[test] -fn test_items_9_0() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 9, 0).unwrap(); -} - -#[test] -fn test_items_9_1() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 9, 1).unwrap(); -} - -#[test] -fn test_items_9_2() { - let path = format!("{}/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::tests::runner::run_test_case(&path, 9, 2).unwrap(); -} - #[test] fn test_traits_0_0() { let path = format!("{}/fixtures/traits.json", env!("CARGO_MANIFEST_DIR")); @@ -1859,6 +1727,114 @@ fn test_traits_3_0() { crate::tests::runner::run_test_case(&path, 3, 0).unwrap(); } +#[test] +fn test_array_0_0() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 0, 0).unwrap(); +} + +#[test] +fn test_array_0_1() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 0, 1).unwrap(); +} + +#[test] +fn test_array_0_2() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 0, 2).unwrap(); +} + +#[test] +fn test_array_1_0() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 1, 0).unwrap(); +} + +#[test] +fn test_array_2_0() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 2, 0).unwrap(); +} + +#[test] +fn test_array_2_1() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 2, 1).unwrap(); +} + +#[test] +fn test_array_3_0() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 3, 0).unwrap(); +} + +#[test] +fn test_array_3_1() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 3, 1).unwrap(); +} + +#[test] +fn test_array_3_2() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 3, 2).unwrap(); +} + +#[test] +fn test_array_3_3() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 3, 3).unwrap(); +} + +#[test] +fn test_array_3_4() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 3, 4).unwrap(); +} + +#[test] +fn test_array_4_0() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 4, 0).unwrap(); +} + +#[test] +fn test_array_4_1() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 4, 1).unwrap(); +} + +#[test] +fn test_array_4_2() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 4, 2).unwrap(); +} + +#[test] +fn test_array_5_0() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 5, 0).unwrap(); +} + +#[test] +fn test_array_6_0() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 6, 0).unwrap(); +} + +#[test] +fn test_array_7_0() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 7, 0).unwrap(); +} + +#[test] +fn test_array_7_1() { + let path = format!("{}/fixtures/array.json", env!("CARGO_MANIFEST_DIR")); + crate::tests::runner::run_test_case(&path, 7, 1).unwrap(); +} + #[test] fn test_enum_0_0() { let path = format!("{}/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); diff --git a/src/validator/rules/dict.rs b/src/validator/rules/dict.rs index 68b1dc1..2f9ec17 100644 --- a/src/validator/rules/dict.rs +++ b/src/validator/rules/dict.rs @@ -1,4 +1,4 @@ -use std::collections::{HashMap, HashSet}; +use std::collections::HashSet; use serde_json::Value;