From b0377e076e8d1458b0fd43ef6a969241dff495af Mon Sep 17 00:00:00 2001 From: Alex Groleau Date: Tue, 23 Jun 2026 17:47:19 -0400 Subject: [PATCH] drop error improvements across the board for localization --- fixtures/additionalProperties.json | 66 +- fixtures/booleanSchema.json | 119 +- fixtures/cases.json | 30 +- fixtures/const.json | 614 ++++- fixtures/contains.json | 207 +- fixtures/database.json | 101 +- fixtures/dependencies.json | 284 +- fixtures/dynamicType.json | 52 +- fixtures/emptyString.json | 6 +- fixtures/enum.json | 406 ++- fixtures/exclusiveMaximum.json | 30 +- fixtures/exclusiveMinimum.json | 30 +- fixtures/format.json | 3892 +++++++++++++++++++++++++--- fixtures/items.json | 625 ++++- fixtures/maxContains.json | 90 +- fixtures/maxItems.json | 45 +- fixtures/maxLength.json | 32 +- fixtures/maxProperties.json | 60 +- fixtures/maximum.json | 30 +- fixtures/merge.json | 32 +- fixtures/minContains.json | 221 +- fixtures/minItems.json | 30 +- fixtures/minLength.json | 47 +- fixtures/minProperties.json | 30 +- fixtures/minimum.json | 45 +- fixtures/multipleOf.json | 47 +- fixtures/not.json | 331 ++- fixtures/objectTypes.json | 57 +- fixtures/paths.json | 77 +- fixtures/pattern.json | 14 +- fixtures/patternProperties.json | 181 +- fixtures/polymorphism.json | 73 +- fixtures/prefixItems.json | 83 +- fixtures/primitiveTypes.json | 798 +++++- fixtures/properties.json | 232 +- fixtures/propertyNames.json | 83 +- fixtures/required.json | 164 +- fixtures/traits.json | 94 +- fixtures/uniqueItems.json | 220 +- src/tests/runner.rs | 2 +- src/tests/types/case.rs | 7 + src/tests/types/expect/drop.rs | 43 +- 42 files changed, 8857 insertions(+), 773 deletions(-) diff --git a/fixtures/additionalProperties.json b/fixtures/additionalProperties.json index 231c2ec..a24cbc1 100644 --- a/fixtures/additionalProperties.json +++ b/fixtures/additionalProperties.json @@ -58,7 +58,19 @@ "schema_id": "schema1", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "boolean" + }, + "details": { + "path": "is_active", + "schema": "schema1" + } + } + ] } } ] @@ -108,7 +120,19 @@ "schema_id": "additionalProperties_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "count", + "schema": "additionalProperties_1_0" + } + } + ] } } ] @@ -168,7 +192,29 @@ "schema_id": "schema3", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "group_a/0", + "schema": "schema3" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "group_a/1", + "schema": "schema3" + } + } + ] } }, { @@ -180,7 +226,19 @@ "schema_id": "schema3", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "group_a", + "schema": "schema3" + } + } + ] } } ] diff --git a/fixtures/booleanSchema.json b/fixtures/booleanSchema.json index 5e2964f..95abc79 100644 --- a/fixtures/booleanSchema.json +++ b/fixtures/booleanSchema.json @@ -120,7 +120,16 @@ "schema_id": "booleanSchema_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "booleanSchema_1_0" + } + } + ] } }, { @@ -129,7 +138,16 @@ "schema_id": "booleanSchema_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "booleanSchema_1_0" + } + } + ] } }, { @@ -138,7 +156,16 @@ "schema_id": "booleanSchema_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "booleanSchema_1_0" + } + } + ] } }, { @@ -147,7 +174,16 @@ "schema_id": "booleanSchema_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "booleanSchema_1_0" + } + } + ] } }, { @@ -156,7 +192,16 @@ "schema_id": "booleanSchema_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "booleanSchema_1_0" + } + } + ] } }, { @@ -167,7 +212,26 @@ "schema_id": "booleanSchema_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "booleanSchema_1_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "foo", + "schema": "booleanSchema_1_0" + } + } + ] } }, { @@ -176,7 +240,16 @@ "schema_id": "booleanSchema_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "booleanSchema_1_0" + } + } + ] } }, { @@ -187,7 +260,26 @@ "schema_id": "booleanSchema_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "booleanSchema_1_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "booleanSchema_1_0" + } + } + ] } }, { @@ -196,7 +288,16 @@ "schema_id": "booleanSchema_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "booleanSchema_1_0" + } + } + ] } } ] diff --git a/fixtures/cases.json b/fixtures/cases.json index 9203f3d..cc97425 100644 --- a/fixtures/cases.json +++ b/fixtures/cases.json @@ -277,20 +277,32 @@ "errors": [ { "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "amount_1" + }, "details": { - "path": "amount_1" + "path": "amount_1", + "schema": "parallel_rules" } }, { "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "amount_2" + }, "details": { - "path": "amount_2" + "path": "amount_2", + "schema": "parallel_rules" } }, { "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "cvv" + }, "details": { - "path": "cvv" + "path": "cvv", + "schema": "parallel_rules" } } ] @@ -309,8 +321,12 @@ "errors": [ { "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "cvv" + }, "details": { - "path": "cvv" + "path": "cvv", + "schema": "parallel_rules" } } ] @@ -362,8 +378,12 @@ "errors": [ { "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "unconditional" + }, "details": { - "path": "unconditional" + "path": "unconditional", + "schema": "missing_when" } } ] diff --git a/fixtures/const.json b/fixtures/const.json index caf0804..bedf326 100644 --- a/fixtures/const.json +++ b/fixtures/const.json @@ -29,7 +29,19 @@ "schema_id": "const_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Number(2)" + }, + "details": { + "path": "", + "schema": "const_0_0" + } + } + ] } }, { @@ -38,7 +50,19 @@ "schema_id": "const_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Number(2)" + }, + "details": { + "path": "", + "schema": "const_0_0" + } + } + ] } } ] @@ -97,7 +121,19 @@ "schema_id": "const_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Object {\"foo\": String(\"bar\"), \"baz\": String(\"bax\")}" + }, + "details": { + "path": "", + "schema": "const_1_0" + } + } + ] } }, { @@ -109,7 +145,39 @@ "schema_id": "const_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Object {\"foo\": String(\"bar\"), \"baz\": String(\"bax\")}" + }, + "details": { + "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" + } + } + ] } } ] @@ -154,7 +222,29 @@ "schema_id": "const_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Array [Object {\"foo\": String(\"bar\")}]" + }, + "details": { + "path": "", + "schema": "const_2_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "const_2_0" + } + } + ] } }, { @@ -167,7 +257,49 @@ "schema_id": "const_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Array [Object {\"foo\": String(\"bar\")}]" + }, + "details": { + "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" + } + } + ] } } ] @@ -202,7 +334,19 @@ "schema_id": "const_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Null" + }, + "details": { + "path": "", + "schema": "const_3_0" + } + } + ] } } ] @@ -237,7 +381,19 @@ "schema_id": "const_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Bool(false)" + }, + "details": { + "path": "", + "schema": "const_4_0" + } + } + ] } }, { @@ -246,7 +402,19 @@ "schema_id": "const_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Bool(false)" + }, + "details": { + "path": "", + "schema": "const_4_0" + } + } + ] } } ] @@ -281,7 +449,19 @@ "schema_id": "const_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Bool(true)" + }, + "details": { + "path": "", + "schema": "const_5_0" + } + } + ] } }, { @@ -290,7 +470,19 @@ "schema_id": "const_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Bool(true)" + }, + "details": { + "path": "", + "schema": "const_5_0" + } + } + ] } } ] @@ -331,7 +523,29 @@ "schema_id": "const_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Array [Bool(false)]" + }, + "details": { + "path": "", + "schema": "const_6_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "const_6_0" + } + } + ] } }, { @@ -342,7 +556,29 @@ "schema_id": "const_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Array [Bool(false)]" + }, + "details": { + "path": "", + "schema": "const_6_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "const_6_0" + } + } + ] } } ] @@ -383,7 +619,29 @@ "schema_id": "const_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Array [Bool(true)]" + }, + "details": { + "path": "", + "schema": "const_7_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "const_7_0" + } + } + ] } }, { @@ -394,7 +652,29 @@ "schema_id": "const_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Array [Bool(true)]" + }, + "details": { + "path": "", + "schema": "const_7_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "const_7_0" + } + } + ] } } ] @@ -435,7 +715,29 @@ "schema_id": "const_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Object {\"a\": Bool(false)}" + }, + "details": { + "path": "", + "schema": "const_8_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "a" + }, + "details": { + "path": "a", + "schema": "const_8_0" + } + } + ] } }, { @@ -446,7 +748,29 @@ "schema_id": "const_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Object {\"a\": Bool(false)}" + }, + "details": { + "path": "", + "schema": "const_8_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "a" + }, + "details": { + "path": "a", + "schema": "const_8_0" + } + } + ] } } ] @@ -487,7 +811,29 @@ "schema_id": "const_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Object {\"a\": Bool(true)}" + }, + "details": { + "path": "", + "schema": "const_9_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "a" + }, + "details": { + "path": "a", + "schema": "const_9_0" + } + } + ] } }, { @@ -498,7 +844,29 @@ "schema_id": "const_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Object {\"a\": Bool(true)}" + }, + "details": { + "path": "", + "schema": "const_9_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "a" + }, + "details": { + "path": "a", + "schema": "const_9_0" + } + } + ] } } ] @@ -524,7 +892,19 @@ "schema_id": "const_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Number(0)" + }, + "details": { + "path": "", + "schema": "const_10_0" + } + } + ] } }, { @@ -551,7 +931,19 @@ "schema_id": "const_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Number(0)" + }, + "details": { + "path": "", + "schema": "const_10_0" + } + } + ] } }, { @@ -560,7 +952,19 @@ "schema_id": "const_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Number(0)" + }, + "details": { + "path": "", + "schema": "const_10_0" + } + } + ] } }, { @@ -569,7 +973,19 @@ "schema_id": "const_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Number(0)" + }, + "details": { + "path": "", + "schema": "const_10_0" + } + } + ] } } ] @@ -595,7 +1011,19 @@ "schema_id": "const_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Number(1)" + }, + "details": { + "path": "", + "schema": "const_11_0" + } + } + ] } }, { @@ -648,7 +1076,19 @@ "schema_id": "const_12_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Number(-2)" + }, + "details": { + "path": "", + "schema": "const_12_0" + } + } + ] } }, { @@ -666,7 +1106,19 @@ "schema_id": "const_12_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Number(-2)" + }, + "details": { + "path": "", + "schema": "const_12_0" + } + } + ] } }, { @@ -675,7 +1127,19 @@ "schema_id": "const_12_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Number(-2)" + }, + "details": { + "path": "", + "schema": "const_12_0" + } + } + ] } } ] @@ -710,7 +1174,19 @@ "schema_id": "const_13_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Number(9007199254740992)" + }, + "details": { + "path": "", + "schema": "const_13_0" + } + } + ] } }, { @@ -728,7 +1204,19 @@ "schema_id": "const_13_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Number(9007199254740992)" + }, + "details": { + "path": "", + "schema": "const_13_0" + } + } + ] } } ] @@ -763,7 +1251,19 @@ "schema_id": "const_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "String(\"hello\\0there\")" + }, + "details": { + "path": "", + "schema": "const_14_0" + } + } + ] } } ] @@ -776,7 +1276,7 @@ "name": "const_15_0", "schemas": { "const_15_0": { - "const": "\u03bc", + "const": "μ", "$comment": "U+03BC" } } @@ -786,7 +1286,7 @@ "tests": [ { "description": "character uses the same codepoint", - "data": "\u03bc", + "data": "μ", "comment": "U+03BC", "schema_id": "const_15_0", "action": "validate", @@ -796,12 +1296,24 @@ }, { "description": "character looks the same but uses a different codepoint", - "data": "\u00b5", + "data": "µ", "comment": "U+00B5", "schema_id": "const_15_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "String(\"μ\")" + }, + "details": { + "path": "", + "schema": "const_15_0" + } + } + ] } } ] @@ -814,7 +1326,7 @@ "name": "const_16_0", "schemas": { "const_16_0": { - "const": "\u00e4", + "const": "ä", "$comment": "U+00E4" } } @@ -824,7 +1336,7 @@ "tests": [ { "description": "character uses the same codepoint", - "data": "\u00e4", + "data": "ä", "comment": "U+00E4", "schema_id": "const_16_0", "action": "validate", @@ -834,12 +1346,24 @@ }, { "description": "character looks the same but uses combining marks", - "data": "a\u0308", + "data": "ä", "comment": "a, U+0308", "schema_id": "const_16_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "String(\"ä\")" + }, + "details": { + "path": "", + "schema": "const_16_0" + } + } + ] } } ] @@ -871,7 +1395,19 @@ "schema_id": "const_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "Object {\"a\": Number(1)}" + }, + "details": { + "path": "", + "schema": "const_17_0" + } + } + ] } }, { diff --git a/fixtures/contains.json b/fixtures/contains.json index faba6fa..70f5c86 100644 --- a/fixtures/contains.json +++ b/fixtures/contains.json @@ -67,7 +67,20 @@ "schema_id": "contains_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "1", + "count": "0" + }, + "details": { + "path": "", + "schema": "contains_0_0" + } + } + ] } }, { @@ -76,7 +89,20 @@ "schema_id": "contains_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "0", + "limit": "1" + }, + "details": { + "path": "", + "schema": "contains_0_0" + } + } + ] } }, { @@ -146,7 +172,20 @@ "schema_id": "contains_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "0", + "limit": "1" + }, + "details": { + "path": "", + "schema": "contains_1_0" + } + } + ] } } ] @@ -183,7 +222,20 @@ "schema_id": "contains_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "1", + "count": "0" + }, + "details": { + "path": "", + "schema": "contains_2_0" + } + } + ] } } ] @@ -211,7 +263,30 @@ "schema_id": "contains_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "0", + "limit": "1" + }, + "details": { + "path": "", + "schema": "contains_3_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "contains_3_0" + } + } + ] } }, { @@ -220,7 +295,20 @@ "schema_id": "contains_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "0", + "limit": "1" + }, + "details": { + "path": "", + "schema": "contains_3_0" + } + } + ] } }, { @@ -264,7 +352,20 @@ "schema_id": "contains_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "1", + "count": "0" + }, + "details": { + "path": "", + "schema": "contains_4_0" + } + } + ] } }, { @@ -277,7 +378,31 @@ "schema_id": "contains_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MULTIPLE_OF_VIOLATED", + "values": { + "value": "3", + "multiple_of": "2" + }, + "details": { + "path": "0", + "schema": "contains_4_0" + } + }, + { + "code": "MULTIPLE_OF_VIOLATED", + "values": { + "multiple_of": "2", + "value": "9" + }, + "details": { + "path": "2", + "schema": "contains_4_0" + } + } + ] } }, { @@ -301,7 +426,42 @@ "schema_id": "contains_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "1", + "count": "0" + }, + "details": { + "path": "", + "schema": "contains_4_0" + } + }, + { + "code": "MULTIPLE_OF_VIOLATED", + "values": { + "multiple_of": "2", + "value": "1" + }, + "details": { + "path": "0", + "schema": "contains_4_0" + } + }, + { + "code": "MULTIPLE_OF_VIOLATED", + "values": { + "multiple_of": "2", + "value": "5" + }, + "details": { + "path": "1", + "schema": "contains_4_0" + } + } + ] } } ] @@ -341,7 +501,20 @@ "schema_id": "contains_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "0", + "limit": "1" + }, + "details": { + "path": "", + "schema": "contains_5_0" + } + } + ] } } ] @@ -434,7 +607,19 @@ "schema_id": "contains_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "1" + }, + "details": { + "path": "1", + "schema": "contains_8_0" + } + } + ] } }, { diff --git a/fixtures/database.json b/fixtures/database.json index e1c5201..e43b47b 100644 --- a/fixtures/database.json +++ b/fixtures/database.json @@ -59,7 +59,16 @@ "success": false, "errors": [ { - "code": "EDGE_MISSING" + "code": "EDGE_MISSING", + "values": { + "parent_type": "org", + "child_type": "user", + "property_name": "missing_users" + }, + "details": { + "path": "full.org/missing_users", + "schema": "full.org" + } } ] } @@ -140,7 +149,16 @@ "success": false, "errors": [ { - "code": "EDGE_MISSING" + "code": "EDGE_MISSING", + "values": { + "child_type": "child", + "property_name": "children", + "parent_type": "parent" + }, + "details": { + "path": "full.parent/children", + "schema": "full.parent" + } } ] } @@ -235,16 +253,45 @@ "errors": [ { "code": "AMBIGUOUS_TYPE_RELATIONS", + "values": { + "child_type": "activity", + "property_name": "activities", + "parent_type": "invoice" + }, "details": { + "path": "full.invoice/activities", "cause": "Multiple conflicting constraints found matching prefixes", "context": [ { - "constraint": "fk_activity_invoice_1" + "id": "33333333-3333-3333-3333-333333333333", + "type": "relation", + "constraint": "fk_activity_invoice_1", + "source_type": "activity", + "source_columns": [ + "invoice_id_1" + ], + "destination_type": "invoice", + "destination_columns": [ + "id" + ], + "prefix": null }, { - "constraint": "fk_activity_invoice_2" + "id": "44444444-4444-4444-4444-444444444444", + "type": "relation", + "constraint": "fk_activity_invoice_2", + "source_type": "activity", + "source_columns": [ + "invoice_id_2" + ], + "destination_type": "invoice", + "destination_columns": [ + "id" + ], + "prefix": null } - ] + ], + "schema": "full.invoice" } } ] @@ -342,16 +389,45 @@ "errors": [ { "code": "AMBIGUOUS_TYPE_RELATIONS", + "values": { + "parent_type": "actor", + "child_type": "junction", + "property_name": "ambiguous_edge" + }, "details": { + "path": "full.actor/ambiguous_edge", "cause": "Multiple conflicting constraints found matching prefixes", "context": [ { - "constraint": "fk_junction_source_actor" + "id": "33333333-3333-3333-3333-333333333333", + "type": "relation", + "constraint": "fk_junction_source_actor", + "source_type": "junction", + "source_columns": [ + "source_id" + ], + "destination_type": "actor", + "destination_columns": [ + "id" + ], + "prefix": "source" }, { - "constraint": "fk_junction_target_actor" + "id": "44444444-4444-4444-4444-444444444444", + "type": "relation", + "constraint": "fk_junction_target_actor", + "source_type": "junction", + "source_columns": [ + "target_id" + ], + "destination_type": "actor", + "destination_columns": [ + "id" + ], + "prefix": "target" } - ] + ], + "schema": "full.actor" } } ] @@ -392,7 +468,14 @@ "success": false, "errors": [ { - "code": "DATABASE_TYPE_PARSE_FAILED" + "code": "DATABASE_TYPE_PARSE_FAILED", + "values": { + "type": "failure", + "reason": "invalid type: sequence, expected a string" + }, + "details": { + "context": "failure" + } } ] } diff --git a/fixtures/dependencies.json b/fixtures/dependencies.json index e135dd9..4eef978 100644 --- a/fixtures/dependencies.json +++ b/fixtures/dependencies.json @@ -60,7 +60,20 @@ "schema_id": "schema1", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "DEPENDENCY_MISSING", + "values": { + "required_property": "foo", + "property_name": "bar" + }, + "details": { + "path": "", + "schema": "schema1" + } + } + ] } }, { @@ -209,7 +222,20 @@ "schema_id": "schema3", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "DEPENDENCY_MISSING", + "values": { + "property_name": "quux", + "required_property": "bar" + }, + "details": { + "path": "", + "schema": "schema3" + } + } + ] } }, { @@ -221,7 +247,20 @@ "schema_id": "schema3", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "DEPENDENCY_MISSING", + "values": { + "property_name": "quux", + "required_property": "foo" + }, + "details": { + "path": "", + "schema": "schema3" + } + } + ] } }, { @@ -232,7 +271,31 @@ "schema_id": "schema3", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "DEPENDENCY_MISSING", + "values": { + "property_name": "quux", + "required_property": "foo" + }, + "details": { + "path": "", + "schema": "schema3" + } + }, + { + "code": "DEPENDENCY_MISSING", + "values": { + "property_name": "quux", + "required_property": "bar" + }, + "details": { + "path": "", + "schema": "schema3" + } + } + ] } } ] @@ -294,7 +357,20 @@ "schema_id": "schema4", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "DEPENDENCY_MISSING", + "values": { + "required_property": "foo\rbar", + "property_name": "foo\nbar" + }, + "details": { + "path": "", + "schema": "schema4" + } + } + ] } }, { @@ -305,7 +381,20 @@ "schema_id": "schema4", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "DEPENDENCY_MISSING", + "values": { + "required_property": "foo'bar", + "property_name": "foo\"bar" + }, + "details": { + "path": "", + "schema": "schema4" + } + } + ] } } ] @@ -409,7 +498,19 @@ "schema_id": "schema_schema1", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "foo", + "schema": "schema_schema1" + } + } + ] } }, { @@ -421,7 +522,19 @@ "schema_id": "schema_schema1", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "bar", + "schema": "schema_schema1" + } + } + ] } }, { @@ -433,7 +546,29 @@ "schema_id": "schema_schema1", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "foo", + "schema": "schema_schema1" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "bar", + "schema": "schema_schema1" + } + } + ] } }, { @@ -447,7 +582,14 @@ "success": false, "errors": [ { - "code": "STRICT_ITEM_VIOLATION" + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "schema_schema1" + } } ] } @@ -559,7 +701,16 @@ "schema_id": "schema_schema3", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "", + "schema": "schema_schema3" + } + } + ] } }, { @@ -571,7 +722,16 @@ "schema_id": "schema_schema3", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "", + "schema": "schema_schema3" + } + } + ] } }, { @@ -642,7 +802,29 @@ "schema_id": "schema_schema4", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "foo\"bar" + }, + "details": { + "path": "foo\"bar", + "schema": "schema_schema4" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo'bar" + }, + "details": { + "path": "foo'bar", + "schema": "schema_schema4" + } + } + ] } }, { @@ -654,7 +836,20 @@ "schema_id": "schema_schema4", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MIN_PROPERTIES_VIOLATED", + "values": { + "count": "2", + "limit": "4" + }, + "details": { + "path": "", + "schema": "schema_schema4" + } + } + ] } }, { @@ -665,7 +860,29 @@ "schema_id": "schema_schema4", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "foo\"bar" + }, + "details": { + "path": "foo\"bar", + "schema": "schema_schema4" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo'bar" + }, + "details": { + "path": "foo'bar", + "schema": "schema_schema4" + } + } + ] } } ] @@ -704,7 +921,19 @@ "schema_id": "schema_schema5", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "foo", + "schema": "schema_schema5" + } + } + ] } }, { @@ -718,7 +947,14 @@ "success": false, "errors": [ { - "code": "STRICT_PROPERTY_VIOLATION" + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "bar" + }, + "details": { + "path": "bar", + "schema": "schema_schema5" + } } ] } @@ -732,7 +968,19 @@ "schema_id": "schema_schema5", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "foo", + "schema": "schema_schema5" + } + } + ] } }, { diff --git a/fixtures/dynamicType.json b/fixtures/dynamicType.json index 1cd9f7c..877d2d8 100644 --- a/fixtures/dynamicType.json +++ b/fixtures/dynamicType.json @@ -41,9 +41,15 @@ "conditions": { "type": "object", "properties": { - "new": { "type": "$kind.filter" }, - "old": { "type": "$kind.filter" }, - "complete": { "type": "$kind.filter" } + "new": { + "type": "$kind.filter" + }, + "old": { + "type": "$kind.filter" + }, + "complete": { + "type": "$kind.filter" + } } } } @@ -82,8 +88,12 @@ "errors": [ { "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, "details": { - "path": "filter/age" + "path": "filter/age", + "schema": "search" } } ] @@ -118,14 +128,22 @@ "errors": [ { "code": "DYNAMIC_TYPE_RESOLUTION_FAILED", + "values": { + "pointer": "unknown.filter" + }, "details": { - "path": "filter" + "path": "filter", + "schema": "search" } }, { "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "weight" + }, "details": { - "path": "filter/weight" + "path": "filter/weight", + "schema": "search" } } ] @@ -145,14 +163,23 @@ "errors": [ { "code": "DYNAMIC_TYPE_RESOLUTION_FAILED", + "values": { + "discriminator": "kind", + "pointer": "$kind.filter" + }, "details": { - "path": "filter" + "path": "filter", + "schema": "search" } }, { "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "weight" + }, "details": { - "path": "filter/weight" + "path": "filter/weight", + "schema": "search" } } ] @@ -191,8 +218,12 @@ "errors": [ { "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, "details": { - "path": "conditions/new/age" + "path": "conditions/new/age", + "schema": "search" } } ] @@ -200,5 +231,4 @@ } ] } -] - +] \ No newline at end of file diff --git a/fixtures/emptyString.json b/fixtures/emptyString.json index 8e2b0b4..b6e5b8e 100644 --- a/fixtures/emptyString.json +++ b/fixtures/emptyString.json @@ -146,8 +146,12 @@ "errors": [ { "code": "CONST_VIOLATED", + "values": { + "expected": "String(\"value\")" + }, "details": { - "path": "con" + "path": "con", + "schema": "emptyString_0_0" } } ] diff --git a/fixtures/enum.json b/fixtures/enum.json index 25f03b4..4993fba 100644 --- a/fixtures/enum.json +++ b/fixtures/enum.json @@ -33,7 +33,19 @@ "schema_id": "enum_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Number(1), Number(2), Number(3)]" + }, + "details": { + "path": "", + "schema": "enum_0_0" + } + } + ] } } ] @@ -79,7 +91,19 @@ "schema_id": "enum_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Number(6), String(\"foo\"), Array [], Bool(true), Object {\"foo\": Number(12)}]" + }, + "details": { + "path": "", + "schema": "enum_1_0" + } + } + ] } }, { @@ -90,7 +114,19 @@ "schema_id": "enum_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Number(6), String(\"foo\"), Array [], Bool(true), Object {\"foo\": Number(12)}]" + }, + "details": { + "path": "", + "schema": "enum_1_0" + } + } + ] } }, { @@ -113,7 +149,29 @@ "schema_id": "enum_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Number(6), String(\"foo\"), Array [], Bool(true), Object {\"foo\": Number(12)}]" + }, + "details": { + "path": "", + "schema": "enum_1_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "boo" + }, + "details": { + "path": "boo", + "schema": "enum_1_0" + } + } + ] } } ] @@ -160,7 +218,19 @@ "schema_id": "enum_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Number(6), Null]" + }, + "details": { + "path": "", + "schema": "enum_2_0" + } + } + ] } } ] @@ -216,7 +286,19 @@ "schema_id": "enum_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[String(\"foo\")]" + }, + "details": { + "path": "foo", + "schema": "enum_3_0" + } + } + ] } }, { @@ -228,7 +310,19 @@ "schema_id": "enum_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[String(\"bar\")]" + }, + "details": { + "path": "bar", + "schema": "enum_3_0" + } + } + ] } }, { @@ -250,7 +344,19 @@ "schema_id": "enum_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "bar" + }, + "details": { + "path": "bar", + "schema": "enum_3_0" + } + } + ] } }, { @@ -259,7 +365,19 @@ "schema_id": "enum_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "bar" + }, + "details": { + "path": "bar", + "schema": "enum_3_0" + } + } + ] } } ] @@ -306,7 +424,19 @@ "schema_id": "enum_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[String(\"foo\\nbar\"), String(\"foo\\rbar\")]" + }, + "details": { + "path": "", + "schema": "enum_4_0" + } + } + ] } } ] @@ -343,7 +473,19 @@ "schema_id": "enum_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Bool(false)]" + }, + "details": { + "path": "", + "schema": "enum_5_0" + } + } + ] } }, { @@ -352,7 +494,19 @@ "schema_id": "enum_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Bool(false)]" + }, + "details": { + "path": "", + "schema": "enum_5_0" + } + } + ] } } ] @@ -395,7 +549,29 @@ "schema_id": "enum_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Array [Bool(false)]]" + }, + "details": { + "path": "", + "schema": "enum_6_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "enum_6_0" + } + } + ] } }, { @@ -406,7 +582,29 @@ "schema_id": "enum_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Array [Bool(false)]]" + }, + "details": { + "path": "", + "schema": "enum_6_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "enum_6_0" + } + } + ] } } ] @@ -443,7 +641,19 @@ "schema_id": "enum_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Bool(true)]" + }, + "details": { + "path": "", + "schema": "enum_7_0" + } + } + ] } }, { @@ -452,7 +662,19 @@ "schema_id": "enum_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Bool(true)]" + }, + "details": { + "path": "", + "schema": "enum_7_0" + } + } + ] } } ] @@ -495,7 +717,29 @@ "schema_id": "enum_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Array [Bool(true)]]" + }, + "details": { + "path": "", + "schema": "enum_8_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "enum_8_0" + } + } + ] } }, { @@ -506,7 +750,29 @@ "schema_id": "enum_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Array [Bool(true)]]" + }, + "details": { + "path": "", + "schema": "enum_8_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "enum_8_0" + } + } + ] } } ] @@ -534,7 +800,19 @@ "schema_id": "enum_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Number(0)]" + }, + "details": { + "path": "", + "schema": "enum_9_0" + } + } + ] } }, { @@ -584,7 +862,29 @@ "schema_id": "enum_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Array [Number(0)]]" + }, + "details": { + "path": "", + "schema": "enum_10_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "enum_10_0" + } + } + ] } }, { @@ -634,7 +934,19 @@ "schema_id": "enum_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Number(1)]" + }, + "details": { + "path": "", + "schema": "enum_11_0" + } + } + ] } }, { @@ -684,7 +996,29 @@ "schema_id": "enum_12_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Array [Number(1)]]" + }, + "details": { + "path": "", + "schema": "enum_12_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "enum_12_0" + } + } + ] } }, { @@ -743,7 +1077,19 @@ "schema_id": "enum_13_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[String(\"hello\\0there\")]" + }, + "details": { + "path": "", + "schema": "enum_13_0" + } + } + ] } } ] @@ -777,7 +1123,19 @@ "schema_id": "enum_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[Object {\"foo\": Number(1)}]" + }, + "details": { + "path": "", + "schema": "enum_14_0" + } + } + ] } }, { diff --git a/fixtures/exclusiveMaximum.json b/fixtures/exclusiveMaximum.json index 634c34f..6ec3f77 100644 --- a/fixtures/exclusiveMaximum.json +++ b/fixtures/exclusiveMaximum.json @@ -29,7 +29,20 @@ "schema_id": "exclusiveMaximum_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "EXCLUSIVE_MAXIMUM_VIOLATED", + "values": { + "value": "3", + "limit": "3" + }, + "details": { + "path": "", + "schema": "exclusiveMaximum_0_0" + } + } + ] } }, { @@ -38,7 +51,20 @@ "schema_id": "exclusiveMaximum_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "EXCLUSIVE_MAXIMUM_VIOLATED", + "values": { + "value": "3.5", + "limit": "3" + }, + "details": { + "path": "", + "schema": "exclusiveMaximum_0_0" + } + } + ] } }, { diff --git a/fixtures/exclusiveMinimum.json b/fixtures/exclusiveMinimum.json index e137796..5e81e15 100644 --- a/fixtures/exclusiveMinimum.json +++ b/fixtures/exclusiveMinimum.json @@ -29,7 +29,20 @@ "schema_id": "exclusiveMinimum_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "EXCLUSIVE_MINIMUM_VIOLATED", + "values": { + "value": "1.1", + "limit": "1.1" + }, + "details": { + "path": "", + "schema": "exclusiveMinimum_0_0" + } + } + ] } }, { @@ -38,7 +51,20 @@ "schema_id": "exclusiveMinimum_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "EXCLUSIVE_MINIMUM_VIOLATED", + "values": { + "limit": "1.1", + "value": "0.6" + }, + "details": { + "path": "", + "schema": "exclusiveMinimum_0_0" + } + } + ] } }, { diff --git a/fixtures/format.json b/fixtures/format.json index 5373369..9e74d3f 100644 --- a/fixtures/format.json +++ b/fixtures/format.json @@ -128,7 +128,20 @@ "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date-time", + "error": "invalid time element: hour/min/sec out of range" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } }, { @@ -137,7 +150,20 @@ "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date-time", + "error": "invalid time element: invalid leap second" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } }, { @@ -146,7 +172,20 @@ "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date-time", + "error": "invalid time element: invalid leap second" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } }, { @@ -155,7 +194,20 @@ "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid date element: february has 28 days only", + "format": "date-time" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } }, { @@ -164,7 +216,20 @@ "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date-time", + "error": "invalid time element: hour/min in offset out of range" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } }, { @@ -173,7 +238,20 @@ "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid time element: offset must be 6 characters long", + "format": "date-time" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } }, { @@ -182,7 +260,20 @@ "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "11th character must be t or T", + "format": "date-time" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } }, { @@ -200,7 +291,20 @@ "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "less than 20 characters long", + "format": "date-time" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } }, { @@ -209,7 +313,20 @@ "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "11th character must be t or T", + "format": "date-time" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } }, { @@ -218,25 +335,64 @@ "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "11th character must be t or T", + "format": "date-time" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } }, { - "description": "invalid non-ASCII '\u09ea' (a Bengali 4) in date portion", - "data": "1963-06-1\u09eaT00:00:00Z", + "description": "invalid non-ASCII '৪' (a Bengali 4) in date portion", + "data": "1963-06-1৪T00:00:00Z", "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date-time", + "error": "11th character must be t or T" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } }, { - "description": "invalid non-ASCII '\u09ea' (a Bengali 4) in time portion", - "data": "1963-06-11T0\u09ea:00:00Z", + "description": "invalid non-ASCII '৪' (a Bengali 4) in time portion", + "data": "1963-06-11T0৪:00:00Z", "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date-time", + "error": "invalid time element: missing colon in correct place" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } }, { @@ -245,7 +401,20 @@ "schema_id": "format_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date-time", + "error": "11th character must be t or T" + }, + "details": { + "path": "", + "schema": "format_0_0" + } + } + ] } } ] @@ -343,7 +512,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "32 days in month", + "format": "date" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -361,7 +543,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "february has 28 days only" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -379,7 +574,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "february has 29 days only", + "format": "date" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -397,7 +605,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "32 days in month" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -415,7 +636,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "month has 30 days only", + "format": "date" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -433,7 +667,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "32 days in month", + "format": "date" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -451,7 +698,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "month has 30 days only", + "format": "date" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -469,7 +729,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "32 days in month" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -487,7 +760,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "32 days in month", + "format": "date" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -505,7 +791,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "month has 30 days only" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -523,7 +822,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "32 days in month" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -541,7 +853,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "month has 30 days only" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -559,7 +884,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "32 days in month", + "format": "date" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -568,7 +906,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "13 months in year" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -577,7 +928,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "missing hyphen in correct place", + "format": "date" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -586,7 +950,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "must be 10 characters long" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -595,7 +972,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "must be 10 characters long" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -604,7 +994,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "must be 10 characters long" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -613,7 +1016,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "13 months in year", + "format": "date" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -622,7 +1038,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "month has 30 days only", + "format": "date" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -631,7 +1060,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "february has 28 days only" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -644,12 +1086,25 @@ } }, { - "description": "invalid non-ASCII '\u09ea' (a Bengali 4)", - "data": "1963-06-1\u09ea", + "description": "invalid non-ASCII '৪' (a Bengali 4)", + "data": "1963-06-1৪", "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "must be 10 characters long" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -658,7 +1113,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "must be 10 characters long" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -667,7 +1135,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "must be 10 characters long", + "format": "date" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -676,7 +1157,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "missing hyphen in correct place" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -685,7 +1179,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "date", + "error": "must be 10 characters long" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } }, { @@ -694,7 +1201,20 @@ "schema_id": "format_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "must be 10 characters long", + "format": "date" + }, + "details": { + "path": "", + "schema": "format_1_0" + } + } + ] } } ] @@ -783,7 +1303,20 @@ "schema_id": "format_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid unit D", + "format": "duration" + }, + "details": { + "path": "", + "schema": "format_2_0" + } + } + ] } }, { @@ -792,7 +1325,20 @@ "schema_id": "format_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "duration", + "error": "must start with P" + }, + "details": { + "path": "", + "schema": "format_2_0" + } + } + ] } }, { @@ -801,7 +1347,20 @@ "schema_id": "format_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "nothing after P", + "format": "duration" + }, + "details": { + "path": "", + "schema": "format_2_0" + } + } + ] } }, { @@ -810,7 +1369,20 @@ "schema_id": "format_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "no time elements", + "format": "duration" + }, + "details": { + "path": "", + "schema": "format_2_0" + } + } + ] } }, { @@ -819,7 +1391,20 @@ "schema_id": "format_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "duration", + "error": "no time elements" + }, + "details": { + "path": "", + "schema": "format_2_0" + } + } + ] } }, { @@ -828,7 +1413,20 @@ "schema_id": "format_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "unit Y out of order", + "format": "duration" + }, + "details": { + "path": "", + "schema": "format_2_0" + } + } + ] } }, { @@ -837,7 +1435,20 @@ "schema_id": "format_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid unit H", + "format": "duration" + }, + "details": { + "path": "", + "schema": "format_2_0" + } + } + ] } }, { @@ -846,7 +1457,20 @@ "schema_id": "format_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid unit S", + "format": "duration" + }, + "details": { + "path": "", + "schema": "format_2_0" + } + } + ] } }, { @@ -927,16 +1551,42 @@ "schema_id": "format_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "duration", + "error": "invalid week" + }, + "details": { + "path": "", + "schema": "format_2_0" + } + } + ] } }, { - "description": "invalid non-ASCII '\u09e8' (a Bengali 2)", - "data": "P\u09e8Y", + "description": "invalid non-ASCII '২' (a Bengali 2)", + "data": "P২Y", "schema_id": "format_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "duration", + "error": "missing number" + }, + "details": { + "path": "", + "schema": "format_2_0" + } + } + ] } }, { @@ -945,7 +1595,20 @@ "schema_id": "format_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "missing unit", + "format": "duration" + }, + "details": { + "path": "", + "schema": "format_2_0" + } + } + ] } } ] @@ -1060,7 +1723,20 @@ "schema_id": "format_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "email", + "error": "missing @" + }, + "details": { + "path": "", + "schema": "format_4_0" + } + } + ] } }, { @@ -1141,7 +1817,20 @@ "schema_id": "format_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "starts with dot", + "format": "email" + }, + "details": { + "path": "", + "schema": "format_4_0" + } + } + ] } }, { @@ -1150,7 +1839,20 @@ "schema_id": "format_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "ends with dot", + "format": "email" + }, + "details": { + "path": "", + "schema": "format_4_0" + } + } + ] } }, { @@ -1168,7 +1870,20 @@ "schema_id": "format_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "email", + "error": "consecutive dots" + }, + "details": { + "path": "", + "schema": "format_4_0" + } + } + ] } }, { @@ -1177,7 +1892,20 @@ "schema_id": "format_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "email", + "error": "invalid domain: invalid character '='" + }, + "details": { + "path": "", + "schema": "format_4_0" + } + } + ] } }, { @@ -1186,7 +1914,20 @@ "schema_id": "format_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "email", + "error": "invalid ipv4 address: invalid IPv4 address syntax" + }, + "details": { + "path": "", + "schema": "format_4_0" + } + } + ] } }, { @@ -1195,7 +1936,20 @@ "schema_id": "format_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "email", + "error": "invalid character '@'" + }, + "details": { + "path": "", + "schema": "format_4_0" + } + } + ] } }, { @@ -1204,7 +1958,20 @@ "schema_id": "format_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "email", + "error": "invalid character '\"'" + }, + "details": { + "path": "", + "schema": "format_4_0" + } + } + ] } } ] @@ -1338,7 +2105,20 @@ "schema_id": "format_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "label must be 1 to 63 characters long" + }, + "details": { + "path": "", + "schema": "format_5_0" + } + } + ] } }, { @@ -1347,7 +2127,20 @@ "schema_id": "format_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "label must be 1 to 63 characters long" + }, + "details": { + "path": "", + "schema": "format_5_0" + } + } + ] } }, { @@ -1356,16 +2149,42 @@ "schema_id": "format_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "label must be 1 to 63 characters long" + }, + "details": { + "path": "", + "schema": "format_5_0" + } + } + ] } }, { "description": "IDN label separator", - "data": "example\uff0ecom", + "data": "example.com", "schema_id": "format_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid character '.'", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_5_0" + } + } + ] } }, { @@ -1383,7 +2202,20 @@ "schema_id": "format_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "label starts with hyphen", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_5_0" + } + } + ] } }, { @@ -1392,7 +2224,20 @@ "schema_id": "format_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "label ends with hyphen" + }, + "details": { + "path": "", + "schema": "format_5_0" + } + } + ] } }, { @@ -1402,7 +2247,20 @@ "schema_id": "format_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "label has -- in 3rd/4th position but does not start with xn--" + }, + "details": { + "path": "", + "schema": "format_5_0" + } + } + ] } }, { @@ -1411,7 +2269,20 @@ "schema_id": "format_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "invalid character '_'" + }, + "details": { + "path": "", + "schema": "format_5_0" + } + } + ] } }, { @@ -1420,7 +2291,20 @@ "schema_id": "format_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "more than 253 characters long", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_5_0" + } + } + ] } }, { @@ -1438,7 +2322,20 @@ "schema_id": "format_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "label must be 1 to 63 characters long" + }, + "details": { + "path": "", + "schema": "format_5_0" + } + } + ] } } ] @@ -1465,7 +2362,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "invalid punycode" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1483,7 +2393,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid punycode/IDN: contains disallowed character", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1493,7 +2416,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid punycode", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1503,7 +2439,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "invalid punycode" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1513,7 +2462,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "invalid punycode" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1543,7 +2505,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid punycode/IDN: contains disallowed character", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1553,7 +2528,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid punycode/IDN: contains disallowed character", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1563,7 +2551,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "invalid punycode/IDN: MIDDLE DOT is allowed between 'l' characters only" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1573,7 +2574,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid punycode/IDN: MIDDLE DOT is allowed between 'l' characters only", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1583,7 +2597,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid punycode/IDN: MIDDLE DOT is allowed between 'l' characters only", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1593,7 +2620,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid punycode/IDN: MIDDLE DOT is allowed between 'l' characters only", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1613,7 +2653,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid punycode/IDN: Greek KERAIA must be followed by Greek character", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1623,7 +2676,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid punycode/IDN: Greek KERAIA must be followed by Greek character", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1643,7 +2709,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "invalid punycode" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1653,7 +2732,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "invalid punycode/IDN: Hebrew GERESH must be preceded by Hebrew character" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1673,7 +2765,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "invalid punycode" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1683,7 +2788,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid punycode/IDN: Hebrew GERESH must be preceded by Hebrew character", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1703,7 +2821,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid punycode/IDN: KATAKANA MIDDLE DOT must be with Hiragana, Katakana, or Han", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1713,7 +2844,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "invalid punycode/IDN: KATAKANA MIDDLE DOT must be with Hiragana, Katakana, or Han" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1753,7 +2897,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid punycode", + "format": "hostname" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1783,7 +2940,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "invalid punycode" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1793,7 +2963,20 @@ "schema_id": "format_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "hostname", + "error": "invalid punycode" + }, + "details": { + "path": "", + "schema": "format_6_0" + } + } + ] } }, { @@ -1899,7 +3082,7 @@ }, { "description": "a valid idn e-mail (example@example.test in Hangul)", - "data": "\uc2e4\ub840@\uc2e4\ub840.\ud14c\uc2a4\ud2b8", + "data": "실례@실례.테스트", "schema_id": "format_7_0", "action": "validate", "expect": { @@ -1912,7 +3095,20 @@ "schema_id": "format_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-email", + "error": "missing @" + }, + "details": { + "path": "", + "schema": "format_7_0" + } + } + ] } }, { @@ -1930,7 +3126,20 @@ "schema_id": "format_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-email", + "error": "missing @" + }, + "details": { + "path": "", + "schema": "format_7_0" + } + } + ] } } ] @@ -2006,7 +3215,7 @@ }, { "description": "a valid host name (example.test in Hangul)", - "data": "\uc2e4\ub840.\ud14c\uc2a4\ud2b8", + "data": "실례.테스트", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2015,29 +3224,68 @@ }, { "description": "illegal first char U+302E Hangul single dot tone mark", - "data": "\u302e\uc2e4\ub840.\ud14c\uc2a4\ud2b8", + "data": "〮실례.테스트", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "contains illegal char U+302E Hangul single dot tone mark", - "data": "\uc2e4\u302e\ub840.\ud14c\uc2a4\ud2b8", + "data": "실〮례.테스트", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "contains disallowed character", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "a host name with a component too long", - "data": "\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\uc2e4\ub840\ub840\ud14c\uc2a4\ud2b8\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ud14c\uc2a4\ud2b8\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ud14c\uc2a4\ud2b8\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ub840\ud14c\uc2a4\ud2b8\ub840\ub840\uc2e4\ub840.\ud14c\uc2a4\ud2b8", + "data": "실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실례례테스트례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례테스트례례실례.테스트", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { @@ -2047,7 +3295,20 @@ "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { @@ -2067,7 +3328,20 @@ "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { @@ -2077,7 +3351,20 @@ "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { @@ -2087,7 +3374,20 @@ "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { @@ -2097,7 +3397,20 @@ "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { @@ -2107,43 +3420,95 @@ "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "Begins with a Spacing Combining Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", - "data": "\u0903hello", + "data": "ःhello", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "Begins with a Nonspacing Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", - "data": "\u0300hello", + "data": "̀hello", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "Begins with an Enclosing Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", - "data": "\u0488hello", + "data": "҈hello", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "Exceptions that are PVALID, left-to-right chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", - "data": "\u00df\u03c2\u0f0b\u3007", + "data": "ßς་〇", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2153,7 +3518,7 @@ { "description": "Exceptions that are PVALID, right-to-left chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", - "data": "\u06fd\u06fe", + "data": "۽۾", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2163,67 +3528,145 @@ { "description": "Exceptions that are DISALLOWED, right-to-left chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", - "data": "\u0640\u07fa", + "data": "ـߺ", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "contains disallowed character", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "Exceptions that are DISALLOWED, left-to-right chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6 Note: The two combining marks (U+302E and U+302F) are in the middle and not at the start", - "data": "\u3031\u3032\u3033\u3034\u3035\u302e\u302f\u303b", + "data": "〱〲〳〴〵〮〯〻", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "contains disallowed character" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "MIDDLE DOT with no preceding 'l'", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", - "data": "a\u00b7l", + "data": "a·l", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "MIDDLE DOT is allowed between 'l' characters only" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "MIDDLE DOT with nothing preceding", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", - "data": "\u00b7l", + "data": "·l", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "MIDDLE DOT is allowed between 'l' characters only", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "MIDDLE DOT with no following 'l'", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", - "data": "l\u00b7a", + "data": "l·a", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "MIDDLE DOT is allowed between 'l' characters only" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "MIDDLE DOT with nothing following", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", - "data": "l\u00b7", + "data": "l·", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "MIDDLE DOT is allowed between 'l' characters only", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "MIDDLE DOT with surrounding 'l's", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", - "data": "l\u00b7l", + "data": "l·l", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2233,27 +3676,53 @@ { "description": "Greek KERAIA not followed by Greek", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", - "data": "\u03b1\u0375S", + "data": "α͵S", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "Greek KERAIA must be followed by Greek character" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "Greek KERAIA not followed by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", - "data": "\u03b1\u0375", + "data": "α͵", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "Greek KERAIA must be followed by Greek character" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "Greek KERAIA followed by Greek", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", - "data": "\u03b1\u0375\u03b2", + "data": "α͵β", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2263,27 +3732,53 @@ { "description": "Hebrew GERESH not preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", - "data": "A\u05f3\u05d1", + "data": "A׳ב", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "Hebrew GERESH not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", - "data": "\u05f3\u05d1", + "data": "׳ב", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "Hebrew GERESH must be preceded by Hebrew character" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "Hebrew GERESH preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", - "data": "\u05d0\u05f3\u05d1", + "data": "א׳ב", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2293,27 +3788,53 @@ { "description": "Hebrew GERSHAYIM not preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", - "data": "A\u05f4\u05d1", + "data": "A״ב", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "Hebrew GERSHAYIM not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", - "data": "\u05f4\u05d1", + "data": "״ב", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "Hebrew GERESH must be preceded by Hebrew character" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "Hebrew GERSHAYIM preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", - "data": "\u05d0\u05f4\u05d1", + "data": "א״ב", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2323,27 +3844,53 @@ { "description": "KATAKANA MIDDLE DOT with no Hiragana, Katakana, or Han", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", - "data": "def\u30fbabc", + "data": "def・abc", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "KATAKANA MIDDLE DOT must be with Hiragana, Katakana, or Han", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "KATAKANA MIDDLE DOT with no other characters", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", - "data": "\u30fb", + "data": "・", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "KATAKANA MIDDLE DOT must be with Hiragana, Katakana, or Han" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "KATAKANA MIDDLE DOT with Hiragana", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", - "data": "\u30fb\u3041", + "data": "・ぁ", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2353,7 +3900,7 @@ { "description": "KATAKANA MIDDLE DOT with Katakana", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", - "data": "\u30fb\u30a1", + "data": "・ァ", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2363,7 +3910,7 @@ { "description": "KATAKANA MIDDLE DOT with Han", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", - "data": "\u30fb\u4e08", + "data": "・丈", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2373,17 +3920,30 @@ { "description": "Arabic-Indic digits mixed with Extended Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8", - "data": "\u0628\u0660\u06f0", + "data": "ب٠۰", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "Arabic-Indic digits not mixed with Extended Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8", - "data": "\u0628\u0660\u0628", + "data": "ب٠ب", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2393,7 +3953,7 @@ { "description": "Extended Arabic-Indic digits not mixed with Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.9", - "data": "\u06f00", + "data": "۰0", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2403,27 +3963,53 @@ { "description": "ZERO WIDTH JOINER not preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", - "data": "\u0915\u200d\u0937", + "data": "क‍ष", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "ZERO WIDTH JOINER not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", - "data": "\u200d\u0937", + "data": "‍ष", "schema_id": "format_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_8_0" + } + } + ] } }, { "description": "ZERO WIDTH JOINER preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", - "data": "\u0915\u094d\u200d\u0937", + "data": "क्‍ष", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2433,7 +4019,7 @@ { "description": "ZERO WIDTH NON-JOINER preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1", - "data": "\u0915\u094d\u200c\u0937", + "data": "क्‌ष", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2443,7 +4029,7 @@ { "description": "ZERO WIDTH NON-JOINER not preceded by Virama but matches regexp", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement", - "data": "\u0628\u064a\u200c\u0628\u064a", + "data": "بي‌بي", "schema_id": "format_8_0", "action": "validate", "expect": { @@ -2533,34 +4119,86 @@ "schema_id": "format_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_9_0" + } + } + ] } }, { "description": "single ideographic full stop", - "data": "\u3002", + "data": "。", "schema_id": "format_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_9_0" + } + } + ] } }, { "description": "single fullwidth full stop", - "data": "\uff0e", + "data": ".", "schema_id": "format_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_9_0" + } + } + ] } }, { "description": "single halfwidth ideographic full stop", - "data": "\uff61", + "data": "。", "schema_id": "format_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_9_0" + } + } + ] } }, { @@ -2574,7 +4212,7 @@ }, { "description": "ideographic full stop as label separator", - "data": "a\u3002b", + "data": "a。b", "schema_id": "format_9_0", "action": "validate", "expect": { @@ -2583,7 +4221,7 @@ }, { "description": "fullwidth full stop as label separator", - "data": "a\uff0eb", + "data": "a.b", "schema_id": "format_9_0", "action": "validate", "expect": { @@ -2592,7 +4230,7 @@ }, { "description": "halfwidth ideographic full stop as label separator", - "data": "a\uff61b", + "data": "a。b", "schema_id": "format_9_0", "action": "validate", "expect": { @@ -2605,34 +4243,86 @@ "schema_id": "format_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_9_0" + } + } + ] } }, { "description": "leading ideographic full stop", - "data": "\u3002example", + "data": "。example", "schema_id": "format_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_9_0" + } + } + ] } }, { "description": "leading fullwidth full stop", - "data": "\uff0eexample", + "data": ".example", "schema_id": "format_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_9_0" + } + } + ] } }, { "description": "leading halfwidth ideographic full stop", - "data": "\uff61example", + "data": "。example", "schema_id": "format_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_9_0" + } + } + ] } }, { @@ -2641,39 +4331,91 @@ "schema_id": "format_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_9_0" + } + } + ] } }, { "description": "trailing ideographic full stop", - "data": "example\u3002", + "data": "example。", "schema_id": "format_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_9_0" + } + } + ] } }, { "description": "trailing fullwidth full stop", - "data": "example\uff0e", + "data": "example.", "schema_id": "format_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "idn-hostname", + "error": "idna error: Errors" + }, + "details": { + "path": "", + "schema": "format_9_0" + } + } + ] } }, { "description": "trailing halfwidth ideographic full stop", - "data": "example\uff61", + "data": "example。", "schema_id": "format_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "idna error: Errors", + "format": "idn-hostname" + }, + "details": { + "path": "", + "schema": "format_9_0" + } + } + ] } }, { "description": "label too long if separator ignored (full stop)", - "data": "\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1.com", + "data": "παράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπα.com", "schema_id": "format_9_0", "action": "validate", "expect": { @@ -2682,7 +4424,7 @@ }, { "description": "label too long if separator ignored (ideographic full stop)", - "data": "\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u3002com", + "data": "παράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπα。com", "schema_id": "format_9_0", "action": "validate", "expect": { @@ -2691,7 +4433,7 @@ }, { "description": "label too long if separator ignored (fullwidth full stop)", - "data": "\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\uff0ecom", + "data": "παράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπα.com", "schema_id": "format_9_0", "action": "validate", "expect": { @@ -2700,7 +4442,7 @@ }, { "description": "label too long if separator ignored (halfwidth ideographic full stop)", - "data": "\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\u03c0\u03b1\uff61com", + "data": "παράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπα。com", "schema_id": "format_9_0", "action": "validate", "expect": { @@ -2793,7 +4535,20 @@ "schema_id": "format_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv4", + "error": "invalid IPv4 address syntax" + }, + "details": { + "path": "", + "schema": "format_10_0" + } + } + ] } }, { @@ -2802,7 +4557,20 @@ "schema_id": "format_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv4", + "error": "invalid IPv4 address syntax" + }, + "details": { + "path": "", + "schema": "format_10_0" + } + } + ] } }, { @@ -2811,7 +4579,20 @@ "schema_id": "format_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv4 address syntax", + "format": "ipv4" + }, + "details": { + "path": "", + "schema": "format_10_0" + } + } + ] } }, { @@ -2820,7 +4601,20 @@ "schema_id": "format_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv4", + "error": "invalid IPv4 address syntax" + }, + "details": { + "path": "", + "schema": "format_10_0" + } + } + ] } }, { @@ -2829,7 +4623,20 @@ "schema_id": "format_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv4 address syntax", + "format": "ipv4" + }, + "details": { + "path": "", + "schema": "format_10_0" + } + } + ] } }, { @@ -2839,7 +4646,20 @@ "schema_id": "format_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv4 address syntax", + "format": "ipv4" + }, + "details": { + "path": "", + "schema": "format_10_0" + } + } + ] } }, { @@ -2852,12 +4672,25 @@ } }, { - "description": "invalid non-ASCII '\u09e8' (a Bengali 2)", - "data": "1\u09e87.0.0.1", + "description": "invalid non-ASCII '২' (a Bengali 2)", + "data": "1২7.0.0.1", "schema_id": "format_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv4 address syntax", + "format": "ipv4" + }, + "details": { + "path": "", + "schema": "format_10_0" + } + } + ] } }, { @@ -2866,7 +4699,20 @@ "schema_id": "format_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv4 address syntax", + "format": "ipv4" + }, + "details": { + "path": "", + "schema": "format_10_0" + } + } + ] } } ] @@ -2955,7 +4801,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv6", + "error": "invalid IPv6 address syntax" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -2973,7 +4832,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv6 address syntax", + "format": "ipv6" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -2982,7 +4854,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv6", + "error": "invalid IPv6 address syntax" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -2991,7 +4876,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv6 address syntax", + "format": "ipv6" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3027,7 +4925,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv6 address syntax", + "format": "ipv6" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3036,7 +4947,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv6 address syntax", + "format": "ipv6" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3045,7 +4969,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv6", + "error": "invalid IPv6 address syntax" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3063,7 +5000,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv6", + "error": "invalid IPv6 address syntax" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3090,7 +5040,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv6", + "error": "invalid IPv6 address syntax" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3099,7 +5062,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv6 address syntax", + "format": "ipv6" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3117,7 +5093,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv6 address syntax", + "format": "ipv6" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3135,7 +5124,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv6 address syntax", + "format": "ipv6" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3144,7 +5146,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv6", + "error": "invalid IPv6 address syntax" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3153,7 +5168,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv6", + "error": "invalid IPv6 address syntax" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3162,7 +5190,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv6 address syntax", + "format": "ipv6" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3171,7 +5212,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv6 address syntax", + "format": "ipv6" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3180,7 +5234,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv6 address syntax", + "format": "ipv6" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3189,7 +5256,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv6", + "error": "invalid IPv6 address syntax" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3198,7 +5278,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid IPv6 address syntax", + "format": "ipv6" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3216,7 +5309,20 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv6", + "error": "invalid IPv6 address syntax" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { @@ -3225,25 +5331,64 @@ "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv6", + "error": "invalid IPv6 address syntax" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { - "description": "invalid non-ASCII '\u09ea' (a Bengali 4)", - "data": "1:2:3:4:5:6:7:\u09ea", + "description": "invalid non-ASCII '৪' (a Bengali 4)", + "data": "1:2:3:4:5:6:7:৪", "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv6", + "error": "invalid IPv6 address syntax" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } }, { - "description": "invalid non-ASCII '\u09ea' (a Bengali 4) in the IPv4 portion", - "data": "1:2::192.16\u09ea.0.1", + "description": "invalid non-ASCII '৪' (a Bengali 4) in the IPv4 portion", + "data": "1:2::192.16৪.0.1", "schema_id": "format_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "ipv6", + "error": "invalid IPv6 address syntax" + }, + "details": { + "path": "", + "schema": "format_11_0" + } + } + ] } } ] @@ -3319,7 +5464,7 @@ }, { "description": "a valid IRI", - "data": "http://\u0192\u00f8\u00f8.\u00df\u00e5r/?\u2202\u00e9\u0153=\u03c0\u00eex#\u03c0\u00ee\u00fcx", + "data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx", "schema_id": "format_12_0", "action": "validate", "expect": { @@ -3328,7 +5473,7 @@ }, { "description": "a valid protocol-relative IRI Reference", - "data": "//\u0192\u00f8\u00f8.\u00df\u00e5r/?\u2202\u00e9\u0153=\u03c0\u00eex#\u03c0\u00ee\u00fcx", + "data": "//ƒøø.ßår/?∂éœ=πîx#πîüx", "schema_id": "format_12_0", "action": "validate", "expect": { @@ -3337,7 +5482,7 @@ }, { "description": "a valid relative IRI Reference", - "data": "/\u00e2\u03c0\u03c0", + "data": "/âππ", "schema_id": "format_12_0", "action": "validate", "expect": { @@ -3346,16 +5491,29 @@ }, { "description": "an invalid IRI Reference", - "data": "\\\\WINDOWS\\fil\u00eb\u00df\u00e5r\u00e9", + "data": "\\\\WINDOWS\\filëßåré", "schema_id": "format_12_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "contains \\\\", + "format": "iri-reference" + }, + "details": { + "path": "", + "schema": "format_12_0" + } + } + ] } }, { "description": "a valid IRI Reference", - "data": "\u00e2\u03c0\u03c0", + "data": "âππ", "schema_id": "format_12_0", "action": "validate", "expect": { @@ -3364,7 +5522,7 @@ }, { "description": "a valid IRI fragment", - "data": "#\u0192r\u00e4gm\u00eant", + "data": "#ƒrägmênt", "schema_id": "format_12_0", "action": "validate", "expect": { @@ -3373,11 +5531,24 @@ }, { "description": "an invalid IRI fragment", - "data": "#\u0192r\u00e4g\\m\u00eant", + "data": "#ƒräg\\mênt", "schema_id": "format_12_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "iri-reference", + "error": "contains \\\\" + }, + "details": { + "path": "", + "schema": "format_12_0" + } + } + ] } } ] @@ -3453,7 +5624,7 @@ }, { "description": "a valid IRI with anchor tag", - "data": "http://\u0192\u00f8\u00f8.\u00df\u00e5r/?\u2202\u00e9\u0153=\u03c0\u00eex#\u03c0\u00ee\u00fcx", + "data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx", "schema_id": "format_13_0", "action": "validate", "expect": { @@ -3462,7 +5633,7 @@ }, { "description": "a valid IRI with anchor tag and parentheses", - "data": "http://\u0192\u00f8\u00f8.com/blah_(w\u00eek\u00efp\u00e9di\u00e5)_blah#\u00dfit\u00e9-1", + "data": "http://ƒøø.com/blah_(wîkïpédiå)_blah#ßité-1", "schema_id": "format_13_0", "action": "validate", "expect": { @@ -3471,7 +5642,7 @@ }, { "description": "a valid IRI with URL-encoded stuff", - "data": "http://\u0192\u00f8\u00f8.\u00df\u00e5r/?q=Test%20URL-encoded%20stuff", + "data": "http://ƒøø.ßår/?q=Test%20URL-encoded%20stuff", "schema_id": "format_13_0", "action": "validate", "expect": { @@ -3502,7 +5673,20 @@ "schema_id": "format_13_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid port number", + "format": "iri" + }, + "details": { + "path": "", + "schema": "format_13_0" + } + } + ] } }, { @@ -3511,25 +5695,64 @@ "schema_id": "format_13_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "iri", + "error": "relative url" + }, + "details": { + "path": "", + "schema": "format_13_0" + } + } + ] } }, { "description": "an invalid IRI", - "data": "\\\\WINDOWS\\fil\u00eb\u00df\u00e5r\u00e9", + "data": "\\\\WINDOWS\\filëßåré", "schema_id": "format_13_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "relative url", + "format": "iri" + }, + "details": { + "path": "", + "schema": "format_13_0" + } + } + ] } }, { "description": "an invalid IRI though valid IRI reference", - "data": "\u00e2\u03c0\u03c0", + "data": "âππ", "schema_id": "format_13_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "iri", + "error": "relative url" + }, + "details": { + "path": "", + "schema": "format_13_0" + } + } + ] } } ] @@ -3618,7 +5841,20 @@ "schema_id": "format_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "~ must be followed by 0 or 1", + "format": "json-pointer" + }, + "details": { + "path": "", + "schema": "format_14_0" + } + } + ] } }, { @@ -3798,7 +6034,20 @@ "schema_id": "format_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "json-pointer", + "error": "not starting with slash" + }, + "details": { + "path": "", + "schema": "format_14_0" + } + } + ] } }, { @@ -3807,7 +6056,20 @@ "schema_id": "format_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "json-pointer", + "error": "not starting with slash" + }, + "details": { + "path": "", + "schema": "format_14_0" + } + } + ] } }, { @@ -3816,7 +6078,20 @@ "schema_id": "format_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "not starting with slash", + "format": "json-pointer" + }, + "details": { + "path": "", + "schema": "format_14_0" + } + } + ] } }, { @@ -3825,7 +6100,20 @@ "schema_id": "format_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "json-pointer", + "error": "~ must be followed by 0 or 1" + }, + "details": { + "path": "", + "schema": "format_14_0" + } + } + ] } }, { @@ -3834,7 +6122,20 @@ "schema_id": "format_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "json-pointer", + "error": "~ must be followed by 0 or 1" + }, + "details": { + "path": "", + "schema": "format_14_0" + } + } + ] } }, { @@ -3843,7 +6144,20 @@ "schema_id": "format_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "json-pointer", + "error": "~ must be followed by 0 or 1" + }, + "details": { + "path": "", + "schema": "format_14_0" + } + } + ] } }, { @@ -3852,7 +6166,20 @@ "schema_id": "format_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "json-pointer", + "error": "~ must be followed by 0 or 1" + }, + "details": { + "path": "", + "schema": "format_14_0" + } + } + ] } }, { @@ -3861,7 +6188,20 @@ "schema_id": "format_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "json-pointer", + "error": "~ must be followed by 0 or 1" + }, + "details": { + "path": "", + "schema": "format_14_0" + } + } + ] } }, { @@ -3870,7 +6210,20 @@ "schema_id": "format_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "json-pointer", + "error": "not starting with slash" + }, + "details": { + "path": "", + "schema": "format_14_0" + } + } + ] } }, { @@ -3879,7 +6232,20 @@ "schema_id": "format_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "json-pointer", + "error": "not starting with slash" + }, + "details": { + "path": "", + "schema": "format_14_0" + } + } + ] } }, { @@ -3888,7 +6254,20 @@ "schema_id": "format_14_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "not starting with slash", + "format": "json-pointer" + }, + "details": { + "path": "", + "schema": "format_14_0" + } + } + ] } } ] @@ -4093,7 +6472,20 @@ "schema_id": "format_16_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "relative-json-pointer", + "error": "must start with non-negative integer" + }, + "details": { + "path": "", + "schema": "format_16_0" + } + } + ] } }, { @@ -4102,7 +6494,20 @@ "schema_id": "format_16_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "relative-json-pointer", + "error": "must start with non-negative integer" + }, + "details": { + "path": "", + "schema": "format_16_0" + } + } + ] } }, { @@ -4111,7 +6516,20 @@ "schema_id": "format_16_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "must start with non-negative integer", + "format": "relative-json-pointer" + }, + "details": { + "path": "", + "schema": "format_16_0" + } + } + ] } }, { @@ -4120,7 +6538,20 @@ "schema_id": "format_16_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid json-pointer element: not starting with slash", + "format": "relative-json-pointer" + }, + "details": { + "path": "", + "schema": "format_16_0" + } + } + ] } }, { @@ -4129,7 +6560,20 @@ "schema_id": "format_16_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "relative-json-pointer", + "error": "starts with zero" + }, + "details": { + "path": "", + "schema": "format_16_0" + } + } + ] } }, { @@ -4138,7 +6582,20 @@ "schema_id": "format_16_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "relative-json-pointer", + "error": "starts with zero" + }, + "details": { + "path": "", + "schema": "format_16_0" + } + } + ] } }, { @@ -4245,7 +6702,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "missing colon in correct place" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4254,7 +6724,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "less than 9 characters long" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4263,7 +6746,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "missing colon in correct place", + "format": "time" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4281,7 +6777,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid leap second", + "format": "time" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4290,7 +6799,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid leap second", + "format": "time" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4308,7 +6830,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "invalid leap second" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4317,7 +6852,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "invalid leap second" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4344,7 +6892,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "invalid leap second" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4353,7 +6914,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "invalid leap second" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4380,7 +6954,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "invalid leap second", + "format": "time" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4389,7 +6976,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "invalid leap second" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4434,7 +7034,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "missing colon in offset at correct place", + "format": "time" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4452,7 +7065,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "hour/min/sec out of range", + "format": "time" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4461,7 +7087,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "hour/min/sec out of range" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4470,7 +7109,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "hour/min/sec out of range", + "format": "time" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4479,7 +7131,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "invalid leap second" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4488,7 +7153,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "invalid leap second" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4497,7 +7175,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "hour/min in offset out of range" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4506,7 +7197,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "hour/min in offset out of range" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4515,7 +7219,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "offset must be 6 characters long" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4524,7 +7241,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "offset must be 6 characters long", + "format": "time" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4533,7 +7263,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "offset must be 6 characters long", + "format": "time" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4542,7 +7285,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "less than 9 characters long" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4551,16 +7307,42 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "offset must be 6 characters long" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { - "description": "invalid non-ASCII '\u09e8' (a Bengali 2)", - "data": "1\u09e8:00:00Z", + "description": "invalid non-ASCII '২' (a Bengali 2)", + "data": "1২:00:00Z", "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "missing colon in correct place" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4569,7 +7351,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "offset must begin with plus/minus", + "format": "time" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4578,7 +7373,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "time", + "error": "less than 9 characters long" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } }, { @@ -4587,7 +7395,20 @@ "schema_id": "format_17_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "missing colon in correct place", + "format": "time" + }, + "details": { + "path": "", + "schema": "format_17_0" + } + } + ] } } ] @@ -4774,7 +7595,20 @@ "schema_id": "format_19_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uri-reference", + "error": "unexpected character at index 0" + }, + "details": { + "path": "", + "schema": "format_19_0" + } + } + ] } }, { @@ -4801,16 +7635,42 @@ "schema_id": "format_19_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uri-reference", + "error": "unexpected character at index 5" + }, + "details": { + "path": "", + "schema": "format_19_0" + } + } + ] } }, { "description": "unescaped non US-ASCII characters", - "data": "/foobar\u00ae.txt", + "data": "/foobar®.txt", "schema_id": "format_19_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uri-reference", + "error": "unexpected character at index 7" + }, + "details": { + "path": "", + "schema": "format_19_0" + } + } + ] } }, { @@ -4819,7 +7679,20 @@ "schema_id": "format_19_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uri-reference", + "error": "unexpected character at index 26" + }, + "details": { + "path": "", + "schema": "format_19_0" + } + } + ] } } ] @@ -4908,7 +7781,20 @@ "schema_id": "format_20_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "no matching closing brace", + "format": "uri-template" + }, + "details": { + "path": "", + "schema": "format_20_0" + } + } + ] } }, { @@ -5123,7 +8009,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "relative url", + "format": "uri" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5132,7 +8031,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uri", + "error": "relative url" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5141,7 +8053,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uri", + "error": "unexpected character at index 0" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5150,7 +8075,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "relative url", + "format": "uri" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5159,7 +8097,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "unexpected character at index 7", + "format": "uri" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5168,7 +8119,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "unexpected character at index 0", + "format": "uri" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5177,7 +8141,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "unexpected character at index 7", + "format": "uri" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5186,16 +8163,42 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "unexpected character at index 9", + "format": "uri" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { "description": "unescaped non US-ASCII characters", - "data": "https://example.org/foobar\u00ae.txt", + "data": "https://example.org/foobar®.txt", "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uri", + "error": "unexpected character at index 26" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5204,7 +8207,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "unexpected character at index 26", + "format": "uri" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5213,7 +8229,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uri", + "error": "unexpected character at index 26" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5222,7 +8251,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uri", + "error": "unexpected character at index 26" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5231,7 +8273,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uri", + "error": "unexpected character at index 26" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5240,7 +8295,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uri", + "error": "unexpected character at index 26" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5249,7 +8317,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "unexpected character at index 26", + "format": "uri" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5258,7 +8339,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uri", + "error": "unexpected character at index 23" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } }, { @@ -5267,7 +8361,20 @@ "schema_id": "format_21_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "unexpected character at index 26", + "format": "uri" + }, + "details": { + "path": "", + "schema": "format_21_0" + } + } + ] } } ] @@ -5383,7 +8490,20 @@ "schema_id": "format_22_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "element 5 must be 12 characters long", + "format": "uuid" + }, + "details": { + "path": "", + "schema": "format_22_0" + } + } + ] } }, { @@ -5392,7 +8512,20 @@ "schema_id": "format_22_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uuid", + "error": "element 4 must be 4 characters long" + }, + "details": { + "path": "", + "schema": "format_22_0" + } + } + ] } }, { @@ -5401,7 +8534,20 @@ "schema_id": "format_22_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uuid", + "error": "non-hex character 'g'" + }, + "details": { + "path": "", + "schema": "format_22_0" + } + } + ] } }, { @@ -5410,7 +8556,20 @@ "schema_id": "format_22_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "element 1 must be 8 characters long", + "format": "uuid" + }, + "details": { + "path": "", + "schema": "format_22_0" + } + } + ] } }, { @@ -5419,7 +8578,20 @@ "schema_id": "format_22_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "element 1 must be 8 characters long", + "format": "uuid" + }, + "details": { + "path": "", + "schema": "format_22_0" + } + } + ] } }, { @@ -5428,7 +8600,20 @@ "schema_id": "format_22_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "uuid", + "error": "element 1 must be 8 characters long" + }, + "details": { + "path": "", + "schema": "format_22_0" + } + } + ] } }, { @@ -5437,7 +8622,20 @@ "schema_id": "format_22_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "element 1 must be 8 characters long", + "format": "uuid" + }, + "details": { + "path": "", + "schema": "format_22_0" + } + } + ] } }, { @@ -5446,7 +8644,20 @@ "schema_id": "format_22_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "error": "element 1 must be 8 characters long", + "format": "uuid" + }, + "details": { + "path": "", + "schema": "format_22_0" + } + } + ] } }, { @@ -5535,7 +8746,20 @@ "schema_id": "format_23_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FORMAT_MISMATCH", + "values": { + "format": "period", + "error": "missing slash" + }, + "details": { + "path": "", + "schema": "format_23_0" + } + } + ] } }, { diff --git a/fixtures/items.json b/fixtures/items.json index b2c85b5..33c48fe 100644 --- a/fixtures/items.json +++ b/fixtures/items.json @@ -38,7 +38,19 @@ "schema_id": "items_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "1", + "schema": "items_0_0" + } + } + ] } }, { @@ -49,7 +61,19 @@ "schema_id": "items_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "foo", + "schema": "items_0_0" + } + } + ] } }, { @@ -61,7 +85,29 @@ "schema_id": "items_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "0" + }, + "details": { + "path": "0", + "schema": "items_0_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "length" + }, + "details": { + "path": "length", + "schema": "items_0_0" + } + } + ] } } ] @@ -130,7 +176,30 @@ "schema_id": "items_2_0", "action": "validate", "expect": { - "success": false + "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" + } + } + ] } }, { @@ -230,7 +299,69 @@ "schema_id": "items_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "0/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "0/1/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "1/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "1/1/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "2/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "2/1/foo", + "schema": "items_3_0" + } + } + ] } }, { @@ -272,7 +403,76 @@ "schema_id": "items_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "0/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "0/1/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "1/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "1/1/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "2/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "2/1/foo", + "schema": "items_3_0" + } + }, + { + "code": "FALSE_SCHEMA", + "details": { + "path": "3", + "schema": "items_3_0" + } + } + ] } }, { @@ -309,7 +509,76 @@ "schema_id": "items_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "0/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "0/1/foo", + "schema": "items_3_0" + } + }, + { + "code": "FALSE_SCHEMA", + "details": { + "path": "0/2", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "1/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "1/1/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "2/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "2/1/foo", + "schema": "items_3_0" + } + } + ] } }, { @@ -338,7 +607,69 @@ "schema_id": "items_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "0", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "1/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "1/1/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "2/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "2/1/foo", + "schema": "items_3_0" + } + } + ] } }, { @@ -370,7 +701,69 @@ "schema_id": "items_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "foo" + }, + "details": { + "path": "0/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "0/1/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "1/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "1/1/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "2/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "2/1/foo", + "schema": "items_3_0" + } + } + ] } }, { @@ -390,7 +783,29 @@ "schema_id": "items_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "0/0/foo", + "schema": "items_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "1/0/foo", + "schema": "items_3_0" + } + } + ] } } ] @@ -495,7 +910,19 @@ "schema_id": "items_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "0/0/0/0", + "schema": "items_4_0" + } + } + ] } }, { @@ -527,7 +954,69 @@ "schema_id": "items_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "0/0/0", + "schema": "items_4_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "0/1/0", + "schema": "items_4_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "0/2/0", + "schema": "items_4_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "1/0/0", + "schema": "items_4_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "1/1/0", + "schema": "items_4_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "1/2/0", + "schema": "items_4_0" + } + } + ] } } ] @@ -608,7 +1097,16 @@ "schema_id": "items_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "3", + "schema": "items_5_0" + } + } + ] } } ] @@ -648,7 +1146,20 @@ "schema_id": "items_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MINIMUM_VIOLATED", + "values": { + "limit": "5", + "value": "3" + }, + "details": { + "path": "0", + "schema": "items_6_0" + } + } + ] } }, { @@ -709,7 +1220,19 @@ "schema_id": "items_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "1", + "schema": "items_7_0" + } + } + ] } } ] @@ -742,7 +1265,23 @@ "schema_id": "items_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "1", + "schema": "items_8_0" + } + }, + { + "code": "FALSE_SCHEMA", + "details": { + "path": "2", + "schema": "items_8_0" + } + } + ] } }, { @@ -812,7 +1351,16 @@ "schema_id": "items_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "0", + "schema": "items_10_0" + } + } + ] } } ] @@ -855,7 +1403,20 @@ "schema_id": "items_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MINIMUM_VIOLATED", + "values": { + "limit": "5", + "value": "4" + }, + "details": { + "path": "0", + "schema": "items_11_0" + } + } + ] } } ] @@ -932,7 +1493,19 @@ "schema_id": "items_13_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "items_13_0" + } + } + ] } } ] @@ -1030,7 +1603,19 @@ "schema_id": "items_15_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "extra" + }, + "details": { + "path": "0/extra", + "schema": "items_15_0" + } + } + ] } } ] diff --git a/fixtures/maxContains.json b/fixtures/maxContains.json index d3fefad..05134e5 100644 --- a/fixtures/maxContains.json +++ b/fixtures/maxContains.json @@ -65,7 +65,20 @@ "schema_id": "maxContains_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "0", + "limit": "1" + }, + "details": { + "path": "", + "schema": "maxContains_1_0" + } + } + ] } }, { @@ -88,7 +101,20 @@ "schema_id": "maxContains_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "2", + "limit": "1" + }, + "details": { + "path": "", + "schema": "maxContains_1_0" + } + } + ] } }, { @@ -113,7 +139,20 @@ "schema_id": "maxContains_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "2", + "limit": "1" + }, + "details": { + "path": "", + "schema": "maxContains_1_0" + } + } + ] } } ] @@ -157,7 +196,20 @@ "schema_id": "maxContains_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "2", + "limit": "1" + }, + "details": { + "path": "", + "schema": "maxContains_2_0" + } + } + ] } } ] @@ -188,7 +240,20 @@ "schema_id": "maxContains_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "0", + "limit": "1" + }, + "details": { + "path": "", + "schema": "maxContains_3_0" + } + } + ] } }, { @@ -214,7 +279,20 @@ "schema_id": "maxContains_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "4", + "limit": "3" + }, + "details": { + "path": "", + "schema": "maxContains_3_0" + } + } + ] } } ] diff --git a/fixtures/maxItems.json b/fixtures/maxItems.json index db8fab3..59752fd 100644 --- a/fixtures/maxItems.json +++ b/fixtures/maxItems.json @@ -48,7 +48,20 @@ "schema_id": "maxItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAX_ITEMS_VIOLATED", + "values": { + "count": "3", + "limit": "2" + }, + "details": { + "path": "", + "schema": "maxItems_0_0" + } + } + ] } }, { @@ -99,7 +112,20 @@ "schema_id": "maxItems_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAX_ITEMS_VIOLATED", + "values": { + "limit": "2", + "count": "3" + }, + "details": { + "path": "", + "schema": "maxItems_1_0" + } + } + ] } } ] @@ -130,7 +156,20 @@ "schema_id": "maxItems_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAX_ITEMS_VIOLATED", + "values": { + "limit": "2", + "count": "3" + }, + "details": { + "path": "", + "schema": "maxItems_2_0" + } + } + ] } } ] diff --git a/fixtures/maxLength.json b/fixtures/maxLength.json index 6a0978a..800e762 100644 --- a/fixtures/maxLength.json +++ b/fixtures/maxLength.json @@ -38,7 +38,20 @@ "schema_id": "maxLength_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAX_LENGTH_VIOLATED", + "values": { + "count": "3", + "limit": "2" + }, + "details": { + "path": "", + "schema": "maxLength_0_0" + } + } + ] } }, { @@ -52,7 +65,7 @@ }, { "description": "two graphemes is long enough", - "data": "\ud83d\udca9\ud83d\udca9", + "data": "💩💩", "schema_id": "maxLength_0_0", "action": "validate", "expect": { @@ -91,7 +104,20 @@ "schema_id": "maxLength_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAX_LENGTH_VIOLATED", + "values": { + "count": "3", + "limit": "2" + }, + "details": { + "path": "", + "schema": "maxLength_1_0" + } + } + ] } } ] diff --git a/fixtures/maxProperties.json b/fixtures/maxProperties.json index e598bba..afa641a 100644 --- a/fixtures/maxProperties.json +++ b/fixtures/maxProperties.json @@ -48,7 +48,20 @@ "schema_id": "maxProperties_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAX_PROPERTIES_VIOLATED", + "values": { + "count": "3", + "limit": "2" + }, + "details": { + "path": "", + "schema": "maxProperties_0_0" + } + } + ] } }, { @@ -121,7 +134,20 @@ "schema_id": "maxProperties_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAX_PROPERTIES_VIOLATED", + "values": { + "count": "3", + "limit": "2" + }, + "details": { + "path": "", + "schema": "maxProperties_1_0" + } + } + ] } } ] @@ -159,7 +185,20 @@ "schema_id": "maxProperties_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAX_PROPERTIES_VIOLATED", + "values": { + "count": "1", + "limit": "0" + }, + "details": { + "path": "", + "schema": "maxProperties_2_0" + } + } + ] } } ] @@ -190,7 +229,20 @@ "schema_id": "maxProperties_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAX_PROPERTIES_VIOLATED", + "values": { + "limit": "2", + "count": "3" + }, + "details": { + "path": "", + "schema": "maxProperties_3_0" + } + } + ] } }, { diff --git a/fixtures/maximum.json b/fixtures/maximum.json index 06febaf..f2e8209 100644 --- a/fixtures/maximum.json +++ b/fixtures/maximum.json @@ -38,7 +38,20 @@ "schema_id": "maximum_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAXIMUM_VIOLATED", + "values": { + "value": "3.5", + "limit": "3" + }, + "details": { + "path": "", + "schema": "maximum_0_0" + } + } + ] } }, { @@ -100,7 +113,20 @@ "schema_id": "maximum_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAXIMUM_VIOLATED", + "values": { + "value": "300.5", + "limit": "300" + }, + "details": { + "path": "", + "schema": "maximum_1_0" + } + } + ] } } ] diff --git a/fixtures/merge.json b/fixtures/merge.json index d1cec1a..8b448ba 100644 --- a/fixtures/merge.json +++ b/fixtures/merge.json @@ -56,8 +56,12 @@ "errors": [ { "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, "details": { - "path": "base_prop" + "path": "base_prop", + "schema": "merge_0_0" } } ] @@ -127,8 +131,12 @@ "errors": [ { "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "a" + }, "details": { - "path": "a" + "path": "a", + "schema": "merge_1_0" } } ] @@ -146,8 +154,12 @@ "errors": [ { "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "b" + }, "details": { - "path": "b" + "path": "b", + "schema": "merge_1_0" } } ] @@ -226,8 +238,13 @@ "errors": [ { "code": "DEPENDENCY_MISSING", + "values": { + "property_name": "trigger", + "required_property": "base_dep" + }, "details": { - "path": "" + "path": "", + "schema": "merge_2_0" } } ] @@ -246,8 +263,13 @@ "errors": [ { "code": "DEPENDENCY_MISSING", + "values": { + "required_property": "child_dep", + "property_name": "trigger" + }, "details": { - "path": "" + "path": "", + "schema": "merge_2_0" } } ] diff --git a/fixtures/minContains.json b/fixtures/minContains.json index d3994a0..4135def 100644 --- a/fixtures/minContains.json +++ b/fixtures/minContains.json @@ -62,7 +62,20 @@ "schema_id": "minContains_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "0", + "limit": "1" + }, + "details": { + "path": "", + "schema": "minContains_1_0" + } + } + ] } }, { @@ -73,7 +86,20 @@ "schema_id": "minContains_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "0", + "limit": "1" + }, + "details": { + "path": "", + "schema": "minContains_1_0" + } + } + ] } }, { @@ -138,7 +164,20 @@ "schema_id": "minContains_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "0", + "limit": "2" + }, + "details": { + "path": "", + "schema": "minContains_2_0" + } + } + ] } }, { @@ -149,7 +188,20 @@ "schema_id": "minContains_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "2", + "count": "1" + }, + "details": { + "path": "", + "schema": "minContains_2_0" + } + } + ] } }, { @@ -161,7 +213,20 @@ "schema_id": "minContains_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "2", + "count": "1" + }, + "details": { + "path": "", + "schema": "minContains_2_0" + } + } + ] } }, { @@ -231,7 +296,20 @@ "schema_id": "minContains_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "2", + "count": "1" + }, + "details": { + "path": "", + "schema": "minContains_3_0" + } + } + ] } }, { @@ -274,7 +352,20 @@ "schema_id": "minContains_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "0", + "limit": "2" + }, + "details": { + "path": "", + "schema": "minContains_4_0" + } + } + ] } }, { @@ -285,7 +376,20 @@ "schema_id": "minContains_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "1", + "limit": "2" + }, + "details": { + "path": "", + "schema": "minContains_4_0" + } + } + ] } }, { @@ -298,7 +402,20 @@ "schema_id": "minContains_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "2", + "count": "3" + }, + "details": { + "path": "", + "schema": "minContains_4_0" + } + } + ] } }, { @@ -341,7 +458,20 @@ "schema_id": "minContains_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "3", + "count": "0" + }, + "details": { + "path": "", + "schema": "minContains_5_0" + } + } + ] } }, { @@ -352,7 +482,20 @@ "schema_id": "minContains_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "count": "1", + "limit": "3" + }, + "details": { + "path": "", + "schema": "minContains_5_0" + } + } + ] } }, { @@ -365,7 +508,20 @@ "schema_id": "minContains_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "1", + "count": "3" + }, + "details": { + "path": "", + "schema": "minContains_5_0" + } + } + ] } }, { @@ -377,7 +533,31 @@ "schema_id": "minContains_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "3", + "count": "2" + }, + "details": { + "path": "", + "schema": "minContains_5_0" + } + }, + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "1", + "count": "2" + }, + "details": { + "path": "", + "schema": "minContains_5_0" + } + } + ] } } ] @@ -472,7 +652,20 @@ "schema_id": "minContains_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONTAINS_VIOLATED", + "values": { + "limit": "1", + "count": "2" + }, + "details": { + "path": "", + "schema": "minContains_7_0" + } + } + ] } } ] diff --git a/fixtures/minItems.json b/fixtures/minItems.json index 493ea0b..356ef40 100644 --- a/fixtures/minItems.json +++ b/fixtures/minItems.json @@ -44,7 +44,20 @@ "schema_id": "minItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MIN_ITEMS_VIOLATED", + "values": { + "count": "0", + "limit": "1" + }, + "details": { + "path": "", + "schema": "minItems_0_0" + } + } + ] } }, { @@ -92,7 +105,20 @@ "schema_id": "minItems_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MIN_ITEMS_VIOLATED", + "values": { + "limit": "1", + "count": "0" + }, + "details": { + "path": "", + "schema": "minItems_1_0" + } + } + ] } } ] diff --git a/fixtures/minLength.json b/fixtures/minLength.json index 39f88d3..e6eb883 100644 --- a/fixtures/minLength.json +++ b/fixtures/minLength.json @@ -38,7 +38,20 @@ "schema_id": "minLength_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MIN_LENGTH_VIOLATED", + "values": { + "count": "1", + "limit": "2" + }, + "details": { + "path": "", + "schema": "minLength_0_0" + } + } + ] } }, { @@ -52,11 +65,24 @@ }, { "description": "one grapheme is not long enough", - "data": "\ud83d\udca9", + "data": "💩", "schema_id": "minLength_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MIN_LENGTH_VIOLATED", + "values": { + "limit": "2", + "count": "1" + }, + "details": { + "path": "", + "schema": "minLength_0_0" + } + } + ] } } ] @@ -91,7 +117,20 @@ "schema_id": "minLength_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MIN_LENGTH_VIOLATED", + "values": { + "count": "1", + "limit": "2" + }, + "details": { + "path": "", + "schema": "minLength_1_0" + } + } + ] } } ] diff --git a/fixtures/minProperties.json b/fixtures/minProperties.json index 2323eee..0f91a0d 100644 --- a/fixtures/minProperties.json +++ b/fixtures/minProperties.json @@ -44,7 +44,20 @@ "schema_id": "minProperties_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MIN_PROPERTIES_VIOLATED", + "values": { + "count": "0", + "limit": "1" + }, + "details": { + "path": "", + "schema": "minProperties_0_0" + } + } + ] } }, { @@ -110,7 +123,20 @@ "schema_id": "minProperties_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MIN_PROPERTIES_VIOLATED", + "values": { + "limit": "1", + "count": "0" + }, + "details": { + "path": "", + "schema": "minProperties_1_0" + } + } + ] } } ] diff --git a/fixtures/minimum.json b/fixtures/minimum.json index 4266767..dd1cf63 100644 --- a/fixtures/minimum.json +++ b/fixtures/minimum.json @@ -38,7 +38,20 @@ "schema_id": "minimum_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MINIMUM_VIOLATED", + "values": { + "value": "0.6", + "limit": "1.1" + }, + "details": { + "path": "", + "schema": "minimum_0_0" + } + } + ] } }, { @@ -109,7 +122,20 @@ "schema_id": "minimum_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MINIMUM_VIOLATED", + "values": { + "limit": "-2", + "value": "-2.0001" + }, + "details": { + "path": "", + "schema": "minimum_1_0" + } + } + ] } }, { @@ -118,7 +144,20 @@ "schema_id": "minimum_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MINIMUM_VIOLATED", + "values": { + "limit": "-2", + "value": "-3" + }, + "details": { + "path": "", + "schema": "minimum_1_0" + } + } + ] } }, { diff --git a/fixtures/multipleOf.json b/fixtures/multipleOf.json index a578a90..b5dd018 100644 --- a/fixtures/multipleOf.json +++ b/fixtures/multipleOf.json @@ -29,7 +29,20 @@ "schema_id": "multipleOf_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MULTIPLE_OF_VIOLATED", + "values": { + "value": "7", + "multiple_of": "2" + }, + "details": { + "path": "", + "schema": "multipleOf_0_0" + } + } + ] } }, { @@ -82,7 +95,20 @@ "schema_id": "multipleOf_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MULTIPLE_OF_VIOLATED", + "values": { + "multiple_of": "1.5", + "value": "35" + }, + "details": { + "path": "", + "schema": "multipleOf_1_0" + } + } + ] } } ] @@ -117,7 +143,20 @@ "schema_id": "multipleOf_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MULTIPLE_OF_VIOLATED", + "values": { + "multiple_of": "0.0001", + "value": "0.00751" + }, + "details": { + "path": "", + "schema": "multipleOf_2_0" + } + } + ] } } ] @@ -131,7 +170,7 @@ "schemas": { "multipleOf_3_0": { "type": "integer", - "multipleOf": 1e-08 + "multipleOf": 1e-8 } } } diff --git a/fixtures/not.json b/fixtures/not.json index 0d2e4e8..666b9c5 100644 --- a/fixtures/not.json +++ b/fixtures/not.json @@ -31,7 +31,16 @@ "schema_id": "not_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_0_0" + } + } + ] } } ] @@ -71,7 +80,16 @@ "schema_id": "not_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_1_0" + } + } + ] } }, { @@ -80,7 +98,16 @@ "schema_id": "not_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_1_0" + } + } + ] } } ] @@ -136,7 +163,16 @@ "schema_id": "not_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_2_0" + } + } + ] } } ] @@ -169,7 +205,26 @@ "schema_id": "not_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "foo", + "schema": "not_3_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "bar" + }, + "details": { + "path": "bar", + "schema": "not_3_0" + } + } + ] } }, { @@ -204,7 +259,16 @@ "schema_id": "not_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_4_0" + } + } + ] } }, { @@ -213,7 +277,16 @@ "schema_id": "not_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_4_0" + } + } + ] } }, { @@ -222,7 +295,16 @@ "schema_id": "not_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_4_0" + } + } + ] } }, { @@ -231,7 +313,16 @@ "schema_id": "not_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_4_0" + } + } + ] } }, { @@ -240,7 +331,16 @@ "schema_id": "not_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_4_0" + } + } + ] } }, { @@ -251,7 +351,26 @@ "schema_id": "not_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_4_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "foo", + "schema": "not_4_0" + } + } + ] } }, { @@ -260,7 +379,16 @@ "schema_id": "not_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_4_0" + } + } + ] } }, { @@ -271,7 +399,26 @@ "schema_id": "not_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_4_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "not_4_0" + } + } + ] } }, { @@ -280,7 +427,16 @@ "schema_id": "not_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_4_0" + } + } + ] } } ] @@ -306,7 +462,16 @@ "schema_id": "not_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_5_0" + } + } + ] } }, { @@ -315,7 +480,16 @@ "schema_id": "not_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_5_0" + } + } + ] } }, { @@ -324,7 +498,16 @@ "schema_id": "not_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_5_0" + } + } + ] } }, { @@ -333,7 +516,16 @@ "schema_id": "not_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_5_0" + } + } + ] } }, { @@ -342,7 +534,16 @@ "schema_id": "not_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_5_0" + } + } + ] } }, { @@ -353,7 +554,26 @@ "schema_id": "not_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_5_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "foo", + "schema": "not_5_0" + } + } + ] } }, { @@ -362,7 +582,16 @@ "schema_id": "not_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_5_0" + } + } + ] } }, { @@ -373,7 +602,26 @@ "schema_id": "not_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_5_0" + } + }, + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "0" + }, + "details": { + "path": "0", + "schema": "not_5_0" + } + } + ] } }, { @@ -382,7 +630,16 @@ "schema_id": "not_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "NOT_VIOLATED", + "details": { + "path": "", + "schema": "not_5_0" + } + } + ] } } ] @@ -574,7 +831,19 @@ "schema_id": "not_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "foo", + "schema": "not_9_0" + } + } + ] } } ] @@ -647,7 +916,19 @@ "schema_id": "not_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "foo" + }, + "details": { + "path": "foo", + "schema": "not_11_0" + } + } + ] } }, { diff --git a/fixtures/objectTypes.json b/fixtures/objectTypes.json index 95efb91..6ce51b9 100644 --- a/fixtures/objectTypes.json +++ b/fixtures/objectTypes.json @@ -55,7 +55,19 @@ }, "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "a" + }, + "details": { + "path": "a", + "schema": "child_type" + } + } + ] } }, { @@ -68,7 +80,19 @@ }, "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "c" + }, + "details": { + "path": "c", + "schema": "child_type" + } + } + ] } } ] @@ -127,7 +151,20 @@ }, "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAXIMUM_VIOLATED", + "values": { + "value": "60", + "limit": "50" + }, + "details": { + "path": "max", + "schema": "custom_budget" + } + } + ] } } ] @@ -205,7 +242,19 @@ }, "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "inv/amount", + "schema": "request" + } + } + ] } } ] diff --git a/fixtures/paths.json b/fixtures/paths.json index efe246e..fc48c12 100644 --- a/fixtures/paths.json +++ b/fixtures/paths.json @@ -127,8 +127,12 @@ "errors": [ { "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, "details": { - "path": "primitives/1" + "path": "primitives/1", + "schema": "hybrid_pathing" } } ] @@ -153,14 +157,22 @@ "errors": [ { "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "name" + }, "details": { - "path": "ad_hoc_objects/1/name" + "path": "ad_hoc_objects/1/name", + "schema": "hybrid_pathing" } }, { "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "age" + }, "details": { - "path": "ad_hoc_objects/1/age" + "path": "ad_hoc_objects/1/age", + "schema": "hybrid_pathing" } } ] @@ -187,8 +199,13 @@ "errors": [ { "code": "MINIMUM_VIOLATED", + "values": { + "limit": "10", + "value": "5" + }, "details": { - "path": "entities/entity-beta/value" + "path": "entities/entity-beta/value", + "schema": "hybrid_pathing" } } ] @@ -220,8 +237,12 @@ "errors": [ { "code": "INVALID_TYPE", + "values": { + "expected": "boolean" + }, "details": { - "path": "deep_entities/parent-omega/nested/child-beta/flag" + "path": "deep_entities/parent-omega/nested/child-beta/flag", + "schema": "hybrid_pathing" } } ] @@ -275,8 +296,12 @@ "errors": [ { "code": "NO_ONEOF_MATCH", + "values": { + "primitive": "boolean" + }, "details": { - "path": "metadata_bubbles/2" + "path": "metadata_bubbles/2", + "schema": "ad_hoc_pathing" } } ] @@ -293,16 +318,22 @@ "type": "relation", "constraint": "fk_family_pathing_table_families_widget", "source_type": "widget", - "source_columns": ["family_pathing_id"], + "source_columns": [ + "family_pathing_id" + ], "destination_type": "family_pathing", - "destination_columns": ["id"], + "destination_columns": [ + "id" + ], "prefix": "table_families" } ], "types": [ { "name": "widget", - "hierarchy": ["widget"], + "hierarchy": [ + "widget" + ], "variations": [ "widget" ], @@ -348,7 +379,9 @@ }, { "name": "family_pathing", - "hierarchy": ["family_pathing"], + "hierarchy": [ + "family_pathing" + ], "schemas": { "family_pathing": { "type": "object", @@ -398,26 +431,42 @@ "errors": [ { "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, "details": { - "path": "table_families/widget-2/amount" + "path": "table_families/widget-2/amount", + "schema": "family_pathing" } }, { "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "nested_metric" + }, "details": { - "path": "table_families/widget-2/details/nested_metric" + "path": "table_families/widget-2/details/nested_metric", + "schema": "family_pathing" } }, { "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "stray_child" + }, "details": { - "path": "table_families/widget-2/details/stray_child" + "path": "table_families/widget-2/details/stray_child", + "schema": "family_pathing" } }, { "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "unexpected_root_prop" + }, "details": { - "path": "table_families/widget-2/unexpected_root_prop" + "path": "table_families/widget-2/unexpected_root_prop", + "schema": "family_pathing" } } ] diff --git a/fixtures/pattern.json b/fixtures/pattern.json index b3c5db5..34ebd37 100644 --- a/fixtures/pattern.json +++ b/fixtures/pattern.json @@ -29,7 +29,19 @@ "schema_id": "pattern_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "PATTERN_VIOLATED", + "values": { + "pattern": "^a*$" + }, + "details": { + "path": "", + "schema": "pattern_0_0" + } + } + ] } }, { diff --git a/fixtures/patternProperties.json b/fixtures/patternProperties.json index 66010bb..765fb26 100644 --- a/fixtures/patternProperties.json +++ b/fixtures/patternProperties.json @@ -51,7 +51,19 @@ "schema_id": "patternProperties_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "foo", + "schema": "patternProperties_0_0" + } + } + ] } }, { @@ -63,7 +75,29 @@ "schema_id": "patternProperties_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "foo", + "schema": "patternProperties_0_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "foooooo", + "schema": "patternProperties_0_0" + } + } + ] } }, { @@ -104,7 +138,19 @@ "schema_id": "patternProperties_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "extra" + }, + "details": { + "path": "extra", + "schema": "patternProperties_0_0" + } + } + ] } } ] @@ -173,7 +219,19 @@ "schema_id": "patternProperties_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "a", + "schema": "patternProperties_1_0" + } + } + ] } }, { @@ -184,7 +242,20 @@ "schema_id": "patternProperties_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAXIMUM_VIOLATED", + "values": { + "value": "31", + "limit": "20" + }, + "details": { + "path": "aaaa", + "schema": "patternProperties_1_0" + } + } + ] } }, { @@ -196,7 +267,30 @@ "schema_id": "patternProperties_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "aaa", + "schema": "patternProperties_1_0" + } + }, + { + "code": "MAXIMUM_VIOLATED", + "values": { + "limit": "20", + "value": "31" + }, + "details": { + "path": "aaaa", + "schema": "patternProperties_1_0" + } + } + ] } } ] @@ -243,7 +337,19 @@ "schema_id": "patternProperties_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "boolean" + }, + "details": { + "path": "a31b", + "schema": "patternProperties_2_0" + } + } + ] } }, { @@ -265,7 +371,19 @@ "schema_id": "patternProperties_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "a_X_3", + "schema": "patternProperties_2_0" + } + } + ] } } ] @@ -307,7 +425,16 @@ "schema_id": "patternProperties_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "bar", + "schema": "patternProperties_3_0" + } + } + ] } }, { @@ -319,7 +446,16 @@ "schema_id": "patternProperties_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "bar", + "schema": "patternProperties_3_0" + } + } + ] } }, { @@ -330,7 +466,16 @@ "schema_id": "patternProperties_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "foobar", + "schema": "patternProperties_3_0" + } + } + ] } }, { @@ -415,7 +560,19 @@ "schema_id": "patternProperties_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "foo", + "schema": "patternProperties_5_0" + } + } + ] } } ] diff --git a/fixtures/polymorphism.json b/fixtures/polymorphism.json index f77d933..a65193c 100644 --- a/fixtures/polymorphism.json +++ b/fixtures/polymorphism.json @@ -123,8 +123,12 @@ "errors": [ { "code": "MISSING_TYPE", + "values": { + "discriminator": "type" + }, "details": { - "path": "" + "path": "", + "schema": "family_entity" } } ] @@ -143,8 +147,13 @@ "errors": [ { "code": "NO_FAMILY_MATCH", + "values": { + "discriminator": "type", + "value": "alien" + }, "details": { - "path": "" + "path": "", + "schema": "family_entity" } } ] @@ -274,8 +283,13 @@ "errors": [ { "code": "NO_FAMILY_MATCH", + "values": { + "discriminator": "type", + "value": "bot" + }, "details": { - "path": "" + "path": "", + "schema": "family_light_org" } } ] @@ -397,8 +411,12 @@ "errors": [ { "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, "details": { - "path": "super_amount" + "path": "super_amount", + "schema": "family_stock_widget" } } ] @@ -509,8 +527,12 @@ "errors": [ { "code": "MISSING_TYPE", + "values": { + "discriminator": "type" + }, "details": { - "path": "" + "path": "", + "schema": "oneOf_union" } } ] @@ -530,8 +552,12 @@ "errors": [ { "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, "details": { - "path": "age" + "path": "age", + "schema": "oneOf_union" } } ] @@ -564,8 +590,13 @@ "errors": [ { "code": "NO_ONEOF_MATCH", + "values": { + "value": "alien", + "discriminator": "type" + }, "details": { - "path": "" + "path": "", + "schema": "oneOf_union" } } ] @@ -643,8 +674,12 @@ "errors": [ { "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, "details": { - "path": "invoice_id" + "path": "invoice_id", + "schema": "oneOf_bubble" } } ] @@ -736,7 +771,8 @@ { "code": "MISSING_KIND", "details": { - "path": "" + "path": "", + "schema": "stock_widget_validation" } } ] @@ -768,8 +804,12 @@ "errors": [ { "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "kind" + }, "details": { - "path": "kind" + "path": "kind", + "schema": "projected_widget_validation" } } ] @@ -866,8 +906,12 @@ "errors": [ { "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, "details": { - "path": "amount" + "path": "amount", + "schema": "family_panel" } } ] @@ -886,8 +930,13 @@ "errors": [ { "code": "NO_FAMILY_MATCH", + "values": { + "value": "unknown_panel", + "discriminator": "kind" + }, "details": { - "path": "" + "path": "", + "schema": "family_panel" } } ] diff --git a/fixtures/prefixItems.json b/fixtures/prefixItems.json index a79fd15..cd11c4b 100644 --- a/fixtures/prefixItems.json +++ b/fixtures/prefixItems.json @@ -42,7 +42,29 @@ "schema_id": "prefixItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "0", + "schema": "prefixItems_0_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "1", + "schema": "prefixItems_0_0" + } + } + ] } }, { @@ -66,7 +88,19 @@ "schema_id": "prefixItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_ITEM_VIOLATION", + "values": { + "index": "2" + }, + "details": { + "path": "2", + "schema": "prefixItems_0_0" + } + } + ] } }, { @@ -88,7 +122,39 @@ "schema_id": "prefixItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "0" + }, + "details": { + "path": "0", + "schema": "prefixItems_0_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "1" + }, + "details": { + "path": "1", + "schema": "prefixItems_0_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "length" + }, + "details": { + "path": "length", + "schema": "prefixItems_0_0" + } + } + ] } } ] @@ -131,7 +197,16 @@ "schema_id": "prefixItems_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "1", + "schema": "prefixItems_1_0" + } + } + ] } }, { diff --git a/fixtures/primitiveTypes.json b/fixtures/primitiveTypes.json index fd0cc51..c45517c 100644 --- a/fixtures/primitiveTypes.json +++ b/fixtures/primitiveTypes.json @@ -38,7 +38,19 @@ "schema_id": "type_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "", + "schema": "type_0_0" + } + } + ] } }, { @@ -47,7 +59,19 @@ "schema_id": "type_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "", + "schema": "type_0_0" + } + } + ] } }, { @@ -56,7 +80,19 @@ "schema_id": "type_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "", + "schema": "type_0_0" + } + } + ] } }, { @@ -65,7 +101,19 @@ "schema_id": "type_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "", + "schema": "type_0_0" + } + } + ] } }, { @@ -74,7 +122,19 @@ "schema_id": "type_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "", + "schema": "type_0_0" + } + } + ] } }, { @@ -83,7 +143,19 @@ "schema_id": "type_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "", + "schema": "type_0_0" + } + } + ] } }, { @@ -92,7 +164,19 @@ "schema_id": "type_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "", + "schema": "type_0_0" + } + } + ] } } ] @@ -145,7 +229,19 @@ "schema_id": "type_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "", + "schema": "type_1_0" + } + } + ] } }, { @@ -154,7 +250,19 @@ "schema_id": "type_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "", + "schema": "type_1_0" + } + } + ] } }, { @@ -163,7 +271,19 @@ "schema_id": "type_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "", + "schema": "type_1_0" + } + } + ] } }, { @@ -172,7 +292,19 @@ "schema_id": "type_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "", + "schema": "type_1_0" + } + } + ] } }, { @@ -181,7 +313,19 @@ "schema_id": "type_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "", + "schema": "type_1_0" + } + } + ] } }, { @@ -190,7 +334,19 @@ "schema_id": "type_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "", + "schema": "type_1_0" + } + } + ] } } ] @@ -216,7 +372,19 @@ "schema_id": "type_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "", + "schema": "type_2_0" + } + } + ] } }, { @@ -225,7 +393,19 @@ "schema_id": "type_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "", + "schema": "type_2_0" + } + } + ] } }, { @@ -261,7 +441,19 @@ "schema_id": "type_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "", + "schema": "type_2_0" + } + } + ] } }, { @@ -270,7 +462,19 @@ "schema_id": "type_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "", + "schema": "type_2_0" + } + } + ] } }, { @@ -279,7 +483,19 @@ "schema_id": "type_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "", + "schema": "type_2_0" + } + } + ] } }, { @@ -288,7 +504,19 @@ "schema_id": "type_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "", + "schema": "type_2_0" + } + } + ] } } ] @@ -314,7 +542,19 @@ "schema_id": "type_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "object" + }, + "details": { + "path": "", + "schema": "type_3_0" + } + } + ] } }, { @@ -323,7 +563,19 @@ "schema_id": "type_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "object" + }, + "details": { + "path": "", + "schema": "type_3_0" + } + } + ] } }, { @@ -332,7 +584,19 @@ "schema_id": "type_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "object" + }, + "details": { + "path": "", + "schema": "type_3_0" + } + } + ] } }, { @@ -350,7 +614,19 @@ "schema_id": "type_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "object" + }, + "details": { + "path": "", + "schema": "type_3_0" + } + } + ] } }, { @@ -359,7 +635,19 @@ "schema_id": "type_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "object" + }, + "details": { + "path": "", + "schema": "type_3_0" + } + } + ] } }, { @@ -368,7 +656,19 @@ "schema_id": "type_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "object" + }, + "details": { + "path": "", + "schema": "type_3_0" + } + } + ] } } ] @@ -394,7 +694,19 @@ "schema_id": "type_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "", + "schema": "type_4_0" + } + } + ] } }, { @@ -403,7 +715,19 @@ "schema_id": "type_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "", + "schema": "type_4_0" + } + } + ] } }, { @@ -412,7 +736,19 @@ "schema_id": "type_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "", + "schema": "type_4_0" + } + } + ] } }, { @@ -421,7 +757,19 @@ "schema_id": "type_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "", + "schema": "type_4_0" + } + } + ] } }, { @@ -439,7 +787,19 @@ "schema_id": "type_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "", + "schema": "type_4_0" + } + } + ] } }, { @@ -448,7 +808,19 @@ "schema_id": "type_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "array" + }, + "details": { + "path": "", + "schema": "type_4_0" + } + } + ] } } ] @@ -474,7 +846,19 @@ "schema_id": "type_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "boolean" + }, + "details": { + "path": "", + "schema": "type_5_0" + } + } + ] } }, { @@ -483,7 +867,19 @@ "schema_id": "type_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "boolean" + }, + "details": { + "path": "", + "schema": "type_5_0" + } + } + ] } }, { @@ -492,7 +888,19 @@ "schema_id": "type_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "boolean" + }, + "details": { + "path": "", + "schema": "type_5_0" + } + } + ] } }, { @@ -501,7 +909,19 @@ "schema_id": "type_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "boolean" + }, + "details": { + "path": "", + "schema": "type_5_0" + } + } + ] } }, { @@ -519,7 +939,19 @@ "schema_id": "type_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "boolean" + }, + "details": { + "path": "", + "schema": "type_5_0" + } + } + ] } }, { @@ -528,7 +960,19 @@ "schema_id": "type_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "boolean" + }, + "details": { + "path": "", + "schema": "type_5_0" + } + } + ] } }, { @@ -555,7 +999,19 @@ "schema_id": "type_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "boolean" + }, + "details": { + "path": "", + "schema": "type_5_0" + } + } + ] } } ] @@ -581,7 +1037,19 @@ "schema_id": "type_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "null" + }, + "details": { + "path": "", + "schema": "type_6_0" + } + } + ] } }, { @@ -590,7 +1058,19 @@ "schema_id": "type_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "null" + }, + "details": { + "path": "", + "schema": "type_6_0" + } + } + ] } }, { @@ -599,7 +1079,19 @@ "schema_id": "type_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "null" + }, + "details": { + "path": "", + "schema": "type_6_0" + } + } + ] } }, { @@ -608,7 +1100,19 @@ "schema_id": "type_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "null" + }, + "details": { + "path": "", + "schema": "type_6_0" + } + } + ] } }, { @@ -626,7 +1130,19 @@ "schema_id": "type_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "null" + }, + "details": { + "path": "", + "schema": "type_6_0" + } + } + ] } }, { @@ -635,7 +1151,19 @@ "schema_id": "type_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "null" + }, + "details": { + "path": "", + "schema": "type_6_0" + } + } + ] } }, { @@ -644,7 +1172,19 @@ "schema_id": "type_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "null" + }, + "details": { + "path": "", + "schema": "type_6_0" + } + } + ] } }, { @@ -653,7 +1193,19 @@ "schema_id": "type_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "null" + }, + "details": { + "path": "", + "schema": "type_6_0" + } + } + ] } }, { @@ -709,7 +1261,19 @@ "schema_id": "type_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "[\"integer\", \"string\"]" + }, + "details": { + "path": "", + "schema": "type_7_0" + } + } + ] } }, { @@ -718,7 +1282,19 @@ "schema_id": "type_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "[\"integer\", \"string\"]" + }, + "details": { + "path": "", + "schema": "type_7_0" + } + } + ] } }, { @@ -727,7 +1303,19 @@ "schema_id": "type_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "[\"integer\", \"string\"]" + }, + "details": { + "path": "", + "schema": "type_7_0" + } + } + ] } }, { @@ -736,7 +1324,19 @@ "schema_id": "type_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "[\"integer\", \"string\"]" + }, + "details": { + "path": "", + "schema": "type_7_0" + } + } + ] } }, { @@ -745,7 +1345,19 @@ "schema_id": "type_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "[\"integer\", \"string\"]" + }, + "details": { + "path": "", + "schema": "type_7_0" + } + } + ] } } ] @@ -782,7 +1394,19 @@ "schema_id": "type_8_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "[\"string\"]" + }, + "details": { + "path": "", + "schema": "type_8_0" + } + } + ] } } ] @@ -834,7 +1458,19 @@ "schema_id": "type_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "[\"array\", \"object\"]" + }, + "details": { + "path": "", + "schema": "type_9_0" + } + } + ] } }, { @@ -843,7 +1479,19 @@ "schema_id": "type_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "[\"array\", \"object\"]" + }, + "details": { + "path": "", + "schema": "type_9_0" + } + } + ] } }, { @@ -852,7 +1500,19 @@ "schema_id": "type_9_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "[\"array\", \"object\"]" + }, + "details": { + "path": "", + "schema": "type_9_0" + } + } + ] } } ] @@ -914,7 +1574,19 @@ "schema_id": "type_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "[\"array\", \"object\", \"null\"]" + }, + "details": { + "path": "", + "schema": "type_10_0" + } + } + ] } }, { @@ -923,7 +1595,19 @@ "schema_id": "type_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "[\"array\", \"object\", \"null\"]" + }, + "details": { + "path": "", + "schema": "type_10_0" + } + } + ] } } ] diff --git a/fixtures/properties.json b/fixtures/properties.json index 712ac29..079d6f3 100644 --- a/fixtures/properties.json +++ b/fixtures/properties.json @@ -42,7 +42,19 @@ "schema_id": "properties_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "bar", + "schema": "properties_0_0" + } + } + ] } }, { @@ -54,7 +66,29 @@ "schema_id": "properties_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "integer" + }, + "details": { + "path": "foo", + "schema": "properties_0_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "bar", + "schema": "properties_0_0" + } + } + ] } }, { @@ -132,7 +166,16 @@ "schema_id": "properties_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "bar", + "schema": "properties_1_0" + } + } + ] } }, { @@ -144,7 +187,16 @@ "schema_id": "properties_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "bar", + "schema": "properties_1_0" + } + } + ] } } ] @@ -212,7 +264,69 @@ "schema_id": "properties_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "foo\nbar", + "schema": "properties_2_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "foo\"bar", + "schema": "properties_2_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "foo\\bar", + "schema": "properties_2_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "foo\rbar", + "schema": "properties_2_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "foo\tbar", + "schema": "properties_2_0" + } + }, + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "foo\fbar", + "schema": "properties_2_0" + } + } + ] } } ] @@ -314,7 +428,19 @@ "schema_id": "properties_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "__proto__", + "schema": "properties_4_0" + } + } + ] } }, { @@ -327,7 +453,19 @@ "schema_id": "properties_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "string" + }, + "details": { + "path": "toString/length", + "schema": "properties_4_0" + } + } + ] } }, { @@ -340,7 +478,29 @@ "schema_id": "properties_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "INVALID_TYPE", + "values": { + "expected": "number" + }, + "details": { + "path": "constructor", + "schema": "properties_4_0" + } + }, + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "length" + }, + "details": { + "path": "constructor/length", + "schema": "properties_4_0" + } + } + ] } }, { @@ -422,7 +582,19 @@ "schema_id": "properties_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "extra" + }, + "details": { + "path": "extra", + "schema": "properties_6_0" + } + } + ] } } ] @@ -461,7 +633,19 @@ "schema_id": "properties_7_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "extra" + }, + "details": { + "path": "nested/extra", + "schema": "properties_7_0" + } + } + ] } } ] @@ -582,7 +766,19 @@ "schema_id": "properties_10_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "extra" + }, + "details": { + "path": "nested/extra", + "schema": "properties_10_0" + } + } + ] } } ] @@ -626,7 +822,19 @@ "schema_id": "properties_11_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "STRICT_PROPERTY_VIOLATION", + "values": { + "property_name": "extra" + }, + "details": { + "path": "list/0/extra", + "schema": "properties_11_0" + } + } + ] } } ] diff --git a/fixtures/propertyNames.json b/fixtures/propertyNames.json index 0128953..f699a64 100644 --- a/fixtures/propertyNames.json +++ b/fixtures/propertyNames.json @@ -38,7 +38,20 @@ "schema_id": "propertyNames_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAX_LENGTH_VIOLATED", + "values": { + "count": "6", + "limit": "3" + }, + "details": { + "path": "", + "schema": "propertyNames_0_0" + } + } + ] } }, { @@ -123,7 +136,19 @@ "schema_id": "propertyNames_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "PATTERN_VIOLATED", + "values": { + "pattern": "^a+$" + }, + "details": { + "path": "", + "schema": "propertyNames_1_0" + } + } + ] } }, { @@ -199,7 +224,16 @@ "schema_id": "propertyNames_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "", + "schema": "propertyNames_3_0" + } + } + ] } }, { @@ -250,7 +284,19 @@ "schema_id": "propertyNames_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "CONST_VIOLATED", + "values": { + "expected": "String(\"foo\")" + }, + "details": { + "path": "", + "schema": "propertyNames_4_0" + } + } + ] } }, { @@ -316,7 +362,19 @@ "schema_id": "propertyNames_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "ENUM_MISMATCH", + "values": { + "expected": "[String(\"foo\"), String(\"bar\")]" + }, + "details": { + "path": "", + "schema": "propertyNames_5_0" + } + } + ] } }, { @@ -367,7 +425,20 @@ "schema_id": "propertyNames_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "MAX_LENGTH_VIOLATED", + "values": { + "limit": "3", + "count": "6" + }, + "details": { + "path": "", + "schema": "propertyNames_6_0" + } + } + ] } } ] diff --git a/fixtures/required.json b/fixtures/required.json index 21fb9fb..6761893 100644 --- a/fixtures/required.json +++ b/fixtures/required.json @@ -39,7 +39,19 @@ "schema_id": "required_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "foo" + }, + "details": { + "path": "foo", + "schema": "required_0_0" + } + } + ] } }, { @@ -194,7 +206,49 @@ "schema_id": "required_3_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "foo\\bar" + }, + "details": { + "path": "foo\\bar", + "schema": "required_3_0" + } + }, + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "foo\rbar" + }, + "details": { + "path": "foo\rbar", + "schema": "required_3_0" + } + }, + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "foo\tbar" + }, + "details": { + "path": "foo\tbar", + "schema": "required_3_0" + } + }, + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "foo\fbar" + }, + "details": { + "path": "foo\fbar", + "schema": "required_3_0" + } + } + ] } } ] @@ -244,7 +298,39 @@ "schema_id": "required_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "__proto__" + }, + "details": { + "path": "__proto__", + "schema": "required_4_0" + } + }, + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "toString" + }, + "details": { + "path": "toString", + "schema": "required_4_0" + } + }, + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "constructor" + }, + "details": { + "path": "constructor", + "schema": "required_4_0" + } + } + ] } }, { @@ -255,7 +341,29 @@ "schema_id": "required_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "toString" + }, + "details": { + "path": "toString", + "schema": "required_4_0" + } + }, + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "constructor" + }, + "details": { + "path": "constructor", + "schema": "required_4_0" + } + } + ] } }, { @@ -268,7 +376,29 @@ "schema_id": "required_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "__proto__" + }, + "details": { + "path": "__proto__", + "schema": "required_4_0" + } + }, + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "constructor" + }, + "details": { + "path": "constructor", + "schema": "required_4_0" + } + } + ] } }, { @@ -281,7 +411,29 @@ "schema_id": "required_4_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "__proto__" + }, + "details": { + "path": "__proto__", + "schema": "required_4_0" + } + }, + { + "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "toString" + }, + "details": { + "path": "toString", + "schema": "required_4_0" + } + } + ] } }, { diff --git a/fixtures/traits.json b/fixtures/traits.json index d44cd4f..d274fae 100644 --- a/fixtures/traits.json +++ b/fixtures/traits.json @@ -8,27 +8,46 @@ "schemas": { "full.person": { "type": "object", - "include": ["emailable", "phonable"], + "include": [ + "emailable", + "phonable" + ], "properties": { - "name": { "type": "string" } + "name": { + "type": "string" + } }, - "required": ["name"] + "required": [ + "name" + ] } }, "traits": { "emailable": { "properties": { - "email": { "type": "string" } + "email": { + "type": "string" + } }, - "required": ["email"], - "display": ["email"] + "required": [ + "email" + ], + "display": [ + "email" + ] }, "phonable": { "properties": { - "phone": { "type": "string" } + "phone": { + "type": "string" + } }, - "required": ["phone"], - "display": ["phone"] + "required": [ + "phone" + ], + "display": [ + "phone" + ] } } } @@ -61,8 +80,12 @@ "errors": [ { "code": "REQUIRED_FIELD_MISSING", + "values": { + "field_name": "email" + }, "details": { - "path": "email" + "path": "email", + "schema": "full.person" } } ] @@ -79,7 +102,9 @@ "schemas": { "full.person": { "type": "object", - "include": ["emailable"], + "include": [ + "emailable" + ], "properties": { "email": { "type": "string", @@ -91,7 +116,9 @@ "traits": { "emailable": { "properties": { - "email": { "type": "string" } + "email": { + "type": "string" + } } } } @@ -111,8 +138,13 @@ "errors": [ { "code": "MAX_LENGTH_VIOLATED", + "values": { + "limit": "5", + "count": "26" + }, "details": { - "path": "email" + "path": "email", + "schema": "full.person" } } ] @@ -129,7 +161,9 @@ "schemas": { "full.person": { "type": "object", - "include": ["nonexistent_trait"] + "include": [ + "nonexistent_trait" + ] } } } @@ -143,7 +177,14 @@ "success": false, "errors": [ { - "code": "TRAIT_NOT_FOUND" + "code": "TRAIT_NOT_FOUND", + "values": { + "include": "nonexistent_trait" + }, + "details": { + "path": "full.person", + "schema": "full.person" + } } ] } @@ -159,15 +200,21 @@ "schemas": { "full.person": { "type": "object", - "include": ["trait_a"] + "include": [ + "trait_a" + ] } }, "traits": { "trait_a": { - "include": ["trait_b"] + "include": [ + "trait_b" + ] }, "trait_b": { - "include": ["trait_a"] + "include": [ + "trait_a" + ] } } } @@ -181,11 +228,18 @@ "success": false, "errors": [ { - "code": "CIRCULAR_INCLUDE_DETECTED" + "code": "CIRCULAR_INCLUDE_DETECTED", + "values": { + "include": "trait_a" + }, + "details": { + "path": "full.person/include/trait_a/include/trait_b", + "schema": "full.person" + } } ] } } ] } -] +] \ No newline at end of file diff --git a/fixtures/uniqueItems.json b/fixtures/uniqueItems.json index 6fb55d1..24aef7f 100644 --- a/fixtures/uniqueItems.json +++ b/fixtures/uniqueItems.json @@ -36,7 +36,16 @@ "schema_id": "uniqueItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_0_0" + } + } + ] } }, { @@ -49,7 +58,16 @@ "schema_id": "uniqueItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_0_0" + } + } + ] } }, { @@ -62,7 +80,16 @@ "schema_id": "uniqueItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_0_0" + } + } + ] } }, { @@ -112,7 +139,16 @@ "schema_id": "uniqueItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_0_0" + } + } + ] } }, { @@ -144,7 +180,16 @@ "schema_id": "uniqueItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_0_0" + } + } + ] } }, { @@ -162,7 +207,16 @@ "schema_id": "uniqueItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_0_0" + } + } + ] } }, { @@ -210,7 +264,16 @@ "schema_id": "uniqueItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_0_0" + } + } + ] } }, { @@ -242,7 +305,16 @@ "schema_id": "uniqueItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_0_0" + } + } + ] } }, { @@ -261,7 +333,16 @@ "schema_id": "uniqueItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_0_0" + } + } + ] } }, { @@ -397,7 +478,16 @@ "schema_id": "uniqueItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_0_0" + } + } + ] } }, { @@ -433,7 +523,16 @@ "schema_id": "uniqueItems_0_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_0_0" + } + } + ] } }, { @@ -527,7 +626,16 @@ "schema_id": "uniqueItems_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_1_0" + } + } + ] } }, { @@ -539,7 +647,16 @@ "schema_id": "uniqueItems_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_1_0" + } + } + ] } }, { @@ -581,7 +698,16 @@ "schema_id": "uniqueItems_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_1_0" + } + } + ] } }, { @@ -595,7 +721,16 @@ "schema_id": "uniqueItems_1_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_1_0" + } + } + ] } } ] @@ -657,7 +792,16 @@ "schema_id": "uniqueItems_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_2_0" + } + } + ] } }, { @@ -669,7 +813,16 @@ "schema_id": "uniqueItems_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_2_0" + } + } + ] } }, { @@ -682,7 +835,16 @@ "schema_id": "uniqueItems_2_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "2", + "schema": "uniqueItems_2_0" + } + } + ] } } ] @@ -1149,7 +1311,16 @@ "schema_id": "uniqueItems_5_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "FALSE_SCHEMA", + "details": { + "path": "2", + "schema": "uniqueItems_5_0" + } + } + ] } } ] @@ -1179,7 +1350,16 @@ "schema_id": "uniqueItems_6_0", "action": "validate", "expect": { - "success": false + "success": false, + "errors": [ + { + "code": "UNIQUE_ITEMS_VIOLATED", + "details": { + "path": "", + "schema": "uniqueItems_6_0" + } + } + ] } }, { diff --git a/src/tests/runner.rs b/src/tests/runner.rs index d26009c..6739fe0 100644 --- a/src/tests/runner.rs +++ b/src/tests/runner.rs @@ -107,7 +107,7 @@ pub fn run_test_case(path: &str, suite_idx: usize, case_idx: usize) -> Result<() match test.action.as_str() { "compile" => { - let result = test.run_compile(db); + let result = test.run_compile(db, path, suite_idx, case_idx); if let Err(e) = result { println!("TEST COMPILE ERROR FOR '{}': {}", test.description, e); failures.push(format!( diff --git a/src/tests/types/case.rs b/src/tests/types/case.rs index 0677795..5bdfcb5 100644 --- a/src/tests/types/case.rs +++ b/src/tests/types/case.rs @@ -41,6 +41,9 @@ impl Case { pub fn run_compile( &self, db_res: &Result, crate::drop::Drop>, + path: &str, + suite_idx: usize, + case_idx: usize, ) -> Result<(), String> { let expect = match &self.expect { Some(e) => e, @@ -52,6 +55,10 @@ impl Case { Err(d) => d.clone(), }; + if env::var("UPDATE_EXPECT").is_ok() { + update_validation_fixture(path, suite_idx, case_idx, &result.errors); + } + expect.assert_drop(&result)?; if let Ok(db) = db_res { diff --git a/src/tests/types/expect/drop.rs b/src/tests/types/expect/drop.rs index e3adf09..d5a9b12 100644 --- a/src/tests/types/expect/drop.rs +++ b/src/tests/types/expect/drop.rs @@ -1,4 +1,5 @@ use super::Expect; +use serde_json::Value; impl Expect { pub fn assert_drop(&self, drop: &crate::drop::Drop) -> Result<(), String> { @@ -14,14 +15,14 @@ impl Expect { if !self.success { if let Some(expected_errors) = &self.errors { - let actual_values: Vec = drop.errors + let actual_values: Vec = drop.errors .iter() .map(|e| serde_json::to_value(e).unwrap()) .collect(); if expected_errors.len() != actual_values.len() { return Err(format!( - "Expected {} errors, but got {}.\nExpected subset: {:?}\nActual full errors: {:?}", + "Expected {} errors, but got {}.\nExpected: {:?}\nActual full errors: {:?}", expected_errors.len(), actual_values.len(), expected_errors, @@ -31,17 +32,15 @@ impl Expect { for (i, expected_val) in expected_errors.iter().enumerate() { let mut matched = false; - for actual_val in &actual_values { - if subset_match(expected_val, actual_val) { + if expected_val == actual_val { matched = true; break; } } - if !matched { return Err(format!( - "Expected error {} was not found in actual errors.\nExpected subset: {}\nActual full errors: {:?}", + "Expected error {} was not found in actual errors.\nExpected: {}\nActual full errors: {:?}", i, serde_json::to_string_pretty(expected_val).unwrap(), drop.errors, @@ -54,35 +53,3 @@ impl Expect { Ok(()) } } - -// Helper to check if `expected` is a structural subset of `actual` -fn subset_match(expected: &serde_json::Value, actual: &serde_json::Value) -> bool { - match (expected, actual) { - (serde_json::Value::Object(exp_map), serde_json::Value::Object(act_map)) => { - for (k, v) in exp_map { - if let Some(act_v) = act_map.get(k) { - if !subset_match(v, act_v) { - return false; - } - } else { - return false; - } - } - true - } - (serde_json::Value::Array(exp_arr), serde_json::Value::Array(act_arr)) => { - // Basic check: array sizes and elements must match exactly in order - if exp_arr.len() != act_arr.len() { - return false; - } - for (e, a) in exp_arr.iter().zip(act_arr.iter()) { - if !subset_match(e, a) { - return false; - } - } - true - } - // For primitives, exact match - (e, a) => e == a, - } -}