chore: JSPG Engine tuple decoupling and core routing optimizations

This commit is contained in:
2026-04-13 22:41:32 -04:00
parent 665a821bf9
commit 0017c598e1
57 changed files with 5510 additions and 5166 deletions

View File

@ -2,9 +2,8 @@
{
"description": "additionalProperties validates properties not matched by properties",
"database": {
"schemas": [
{
"$id": "schema1",
"schemas": {
"schema1": {
"properties": {
"foo": {
"type": "string"
@ -17,7 +16,7 @@
"type": "boolean"
}
}
]
}
},
"tests": [
{
@ -62,8 +61,8 @@
{
"description": "extensible: true with additionalProperties still validates structure",
"database": {
"schemas": [
{
"schemas": {
"additionalProperties_1_0": {
"properties": {
"foo": {
"type": "string"
@ -72,10 +71,9 @@
"extensible": true,
"additionalProperties": {
"type": "integer"
},
"$id": "additionalProperties_1_0"
}
}
]
}
},
"tests": [
{
@ -108,9 +106,8 @@
{
"description": "complex additionalProperties with object and array items",
"database": {
"schemas": [
{
"$id": "schema3",
"schemas": {
"schema3": {
"properties": {
"type": {
"type": "string"
@ -123,7 +120,7 @@
}
}
}
]
}
},
"tests": [
{

View File

@ -2,11 +2,9 @@
{
"description": "boolean schema 'true'",
"database": {
"schemas": [
{
"$id": "booleanSchema_0_0"
}
]
"schemas": {
"booleanSchema_0_0": {}
}
},
"tests": [
{
@ -99,12 +97,11 @@
{
"description": "boolean schema 'false'",
"database": {
"schemas": [
{
"not": {},
"$id": "booleanSchema_1_0"
"schemas": {
"booleanSchema_1_0": {
"not": {}
}
]
}
},
"tests": [
{

View File

@ -2,87 +2,193 @@
{
"description": "Multi-Paradigm Declarative Cases",
"database": {
"schemas": [
{
"$id": "parallel_rules",
"schemas": {
"parallel_rules": {
"type": "object",
"properties": {
"status": { "type": "string" },
"kind": { "type": "string" }
},
"cases": [
{
"when": { "properties": { "status": {"const": "unverified"} }, "required": ["status"] },
"then": {
"properties": {
"amount_1": {"type": "number"},
"amount_2": {"type": "number"}
},
"required": ["amount_1", "amount_2"]
}
"status": {
"type": "string"
},
{
"when": { "properties": { "kind": {"const": "credit"} }, "required": ["kind"] },
"then": {
"properties": {
"cvv": {"type": "number"}
},
"required": ["cvv"]
}
"kind": {
"type": "string"
}
]
},
{
"$id": "mutually_exclusive",
"type": "object",
"properties": {
"type": { "type": "string" }
},
"cases": [
{
"when": { "properties": { "type": {"const": "A"} }, "required": ["type"] },
"then": {
"properties": { "field_a": {"type": "number"} },
"required": ["field_a"]
}
},
{
"when": { "properties": { "type": {"const": "B"} }, "required": ["type"] },
"then": {
"properties": { "field_b": {"type": "number"} },
"required": ["field_b"]
"when": {
"properties": {
"status": {
"const": "unverified"
}
},
"required": [
"status"
]
},
"else": {
"properties": { "fallback_b": {"type": "number"} },
"required": ["fallback_b"]
"then": {
"properties": {
"amount_1": {
"type": "number"
},
"amount_2": {
"type": "number"
}
},
"required": [
"amount_1",
"amount_2"
]
}
},
{
"when": {
"properties": {
"kind": {
"const": "credit"
}
},
"required": [
"kind"
]
},
"then": {
"properties": {
"cvv": {
"type": "number"
}
},
"required": [
"cvv"
]
}
}
]
},
{
"$id": "nested_fallbacks",
"mutually_exclusive": {
"type": "object",
"properties": {
"tier": { "type": "string" }
"type": {
"type": "string"
}
},
"cases": [
{
"when": { "properties": { "tier": {"const": "1"} }, "required": ["tier"] },
"then": {
"properties": { "basic": {"type": "number"} },
"required": ["basic"]
"when": {
"properties": {
"type": {
"const": "A"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"field_a": {
"type": "number"
}
},
"required": [
"field_a"
]
}
},
{
"when": {
"properties": {
"type": {
"const": "B"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"field_b": {
"type": "number"
}
},
"required": [
"field_b"
]
},
"else": {
"properties": {
"fallback_b": {
"type": "number"
}
},
"required": [
"fallback_b"
]
}
}
]
},
"nested_fallbacks": {
"type": "object",
"properties": {
"tier": {
"type": "string"
}
},
"cases": [
{
"when": {
"properties": {
"tier": {
"const": "1"
}
},
"required": [
"tier"
]
},
"then": {
"properties": {
"basic": {
"type": "number"
}
},
"required": [
"basic"
]
},
"else": {
"cases": [
{
"when": { "properties": { "tier": {"const": "2"} }, "required": ["tier"] },
"then": {
"properties": { "standard": {"type": "number"} },
"required": ["standard"]
"when": {
"properties": {
"tier": {
"const": "2"
}
},
"required": [
"tier"
]
},
"else": {
"properties": { "premium": {"type": "number"} },
"required": ["premium"]
"then": {
"properties": {
"standard": {
"type": "number"
}
},
"required": [
"standard"
]
},
"else": {
"properties": {
"premium": {
"type": "number"
}
},
"required": [
"premium"
]
}
}
]
@ -90,94 +196,159 @@
}
]
},
{
"$id": "missing_when",
"missing_when": {
"type": "object",
"cases": [
{
"else": {
"properties": { "unconditional": {"type": "number"} },
"required": ["unconditional"]
"else": {
"properties": {
"unconditional": {
"type": "number"
}
},
"required": [
"unconditional"
]
}
}
]
}
]
}
},
"tests": [
{
"description": "Fires only the first rule successfully",
"data": { "status": "unverified", "amount_1": 1, "amount_2": 2 },
"data": {
"status": "unverified",
"amount_1": 1,
"amount_2": 2
},
"schema_id": "parallel_rules",
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "Fires both independent parallel rules flawlessly",
"data": { "status": "unverified", "kind": "credit", "amount_1": 1, "amount_2": 2, "cvv": 123 },
"data": {
"status": "unverified",
"kind": "credit",
"amount_1": 1,
"amount_2": 2,
"cvv": 123
},
"schema_id": "parallel_rules",
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "Catches errors triggered concurrently by multiple independent blocked rules",
"data": { "status": "unverified", "kind": "credit" },
"data": {
"status": "unverified",
"kind": "credit"
},
"schema_id": "parallel_rules",
"action": "validate",
"expect": {
"success": false,
"errors": [
{ "code": "REQUIRED_FIELD_MISSING", "details": { "path": "amount_1" } },
{ "code": "REQUIRED_FIELD_MISSING", "details": { "path": "amount_2" } },
{ "code": "REQUIRED_FIELD_MISSING", "details": { "path": "cvv" } }
{
"code": "REQUIRED_FIELD_MISSING",
"details": {
"path": "amount_1"
}
},
{
"code": "REQUIRED_FIELD_MISSING",
"details": {
"path": "amount_2"
}
},
{
"code": "REQUIRED_FIELD_MISSING",
"details": {
"path": "cvv"
}
}
]
}
},
{
"description": "STRICT_PROPERTY_VIOLATION throws if an un-triggered then property is submitted",
"data": { "status": "verified", "cvv": 123 },
"data": {
"status": "verified",
"cvv": 123
},
"schema_id": "parallel_rules",
"action": "validate",
"expect": {
"success": false,
"errors": [
{ "code": "STRICT_PROPERTY_VIOLATION", "details": { "path": "cvv" } }
{
"code": "STRICT_PROPERTY_VIOLATION",
"details": {
"path": "cvv"
}
}
]
}
},
{
"description": "Successfully routes mutually exclusive properties seamlessly",
"data": { "type": "A", "field_a": 1, "fallback_b": 2 },
"data": {
"type": "A",
"field_a": 1,
"fallback_b": 2
},
"schema_id": "mutually_exclusive",
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "Nested fallbacks execute seamlessly",
"data": { "tier": "3", "premium": 1 },
"data": {
"tier": "3",
"premium": 1
},
"schema_id": "nested_fallbacks",
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "A case without a when executes its else indiscriminately",
"data": { "unconditional": 1 },
"data": {
"unconditional": 1
},
"schema_id": "missing_when",
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "A case without a when throws if else unconditionally requires field",
"data": { },
"data": {},
"schema_id": "missing_when",
"action": "validate",
"expect": {
"success": false,
"errors": [
{ "code": "REQUIRED_FIELD_MISSING", "details": { "path": "unconditional" } }
{
"code": "REQUIRED_FIELD_MISSING",
"details": {
"path": "unconditional"
}
}
]
}
}
]
}
]
]

View File

@ -2,12 +2,11 @@
{
"description": "const validation",
"database": {
"schemas": [
{
"const": 2,
"$id": "const_0_0"
"schemas": {
"const_0_0": {
"const": 2
}
]
}
},
"tests": [
{
@ -42,8 +41,8 @@
{
"description": "const with object",
"database": {
"schemas": [
{
"schemas": {
"const_1_0": {
"const": {
"foo": "bar",
"baz": "bax"
@ -51,10 +50,9 @@
"properties": {
"foo": {},
"baz": {}
},
"$id": "const_1_0"
}
}
]
}
},
"tests": [
{
@ -109,16 +107,15 @@
{
"description": "const with array",
"database": {
"schemas": [
{
"schemas": {
"const_2_0": {
"const": [
{
"foo": "bar"
}
],
"$id": "const_2_0"
]
}
]
}
},
"tests": [
{
@ -163,12 +160,11 @@
{
"description": "const with null",
"database": {
"schemas": [
{
"const": null,
"$id": "const_3_0"
"schemas": {
"const_3_0": {
"const": null
}
]
}
},
"tests": [
{
@ -194,12 +190,11 @@
{
"description": "const with false does not match 0",
"database": {
"schemas": [
{
"const": false,
"$id": "const_4_0"
"schemas": {
"const_4_0": {
"const": false
}
]
}
},
"tests": [
{
@ -234,12 +229,11 @@
{
"description": "const with true does not match 1",
"database": {
"schemas": [
{
"const": true,
"$id": "const_5_0"
"schemas": {
"const_5_0": {
"const": true
}
]
}
},
"tests": [
{
@ -274,14 +268,13 @@
{
"description": "const with [false] does not match [0]",
"database": {
"schemas": [
{
"schemas": {
"const_6_0": {
"const": [
false
],
"$id": "const_6_0"
]
}
]
}
},
"tests": [
{
@ -322,14 +315,13 @@
{
"description": "const with [true] does not match [1]",
"database": {
"schemas": [
{
"schemas": {
"const_7_0": {
"const": [
true
],
"$id": "const_7_0"
]
}
]
}
},
"tests": [
{
@ -370,14 +362,13 @@
{
"description": "const with {\"a\": false} does not match {\"a\": 0}",
"database": {
"schemas": [
{
"schemas": {
"const_8_0": {
"const": {
"a": false
},
"$id": "const_8_0"
}
}
]
}
},
"tests": [
{
@ -418,14 +409,13 @@
{
"description": "const with {\"a\": true} does not match {\"a\": 1}",
"database": {
"schemas": [
{
"schemas": {
"const_9_0": {
"const": {
"a": true
},
"$id": "const_9_0"
}
}
]
}
},
"tests": [
{
@ -466,12 +456,11 @@
{
"description": "const with 0 does not match other zero-like types",
"database": {
"schemas": [
{
"const": 0,
"$id": "const_10_0"
"schemas": {
"const_10_0": {
"const": 0
}
]
}
},
"tests": [
{
@ -533,12 +522,11 @@
{
"description": "const with 1 does not match true",
"database": {
"schemas": [
{
"const": 1,
"$id": "const_11_0"
"schemas": {
"const_11_0": {
"const": 1
}
]
}
},
"tests": [
{
@ -573,12 +561,11 @@
{
"description": "const with -2.0 matches integer and float types",
"database": {
"schemas": [
{
"const": -2,
"$id": "const_12_0"
"schemas": {
"const_12_0": {
"const": -2
}
]
}
},
"tests": [
{
@ -631,12 +618,11 @@
{
"description": "float and integers are equal up to 64-bit representation limits",
"database": {
"schemas": [
{
"const": 9007199254740992,
"$id": "const_13_0"
"schemas": {
"const_13_0": {
"const": 9007199254740992
}
]
}
},
"tests": [
{
@ -680,12 +666,11 @@
{
"description": "nul characters in strings",
"database": {
"schemas": [
{
"const": "hello\u0000there",
"$id": "const_14_0"
"schemas": {
"const_14_0": {
"const": "hello\u0000there"
}
]
}
},
"tests": [
{
@ -711,13 +696,12 @@
{
"description": "characters with the same visual representation but different codepoint",
"database": {
"schemas": [
{
"schemas": {
"const_15_0": {
"const": "μ",
"$comment": "U+03BC",
"$id": "const_15_0"
"$comment": "U+03BC"
}
]
}
},
"tests": [
{
@ -745,13 +729,12 @@
{
"description": "characters with the same visual representation, but different number of codepoints",
"database": {
"schemas": [
{
"schemas": {
"const_16_0": {
"const": "ä",
"$comment": "U+00E4",
"$id": "const_16_0"
"$comment": "U+00E4"
}
]
}
},
"tests": [
{
@ -779,15 +762,14 @@
{
"description": "extensible: true allows extra properties in const object match",
"database": {
"schemas": [
{
"schemas": {
"const_17_0": {
"const": {
"a": 1
},
"extensible": true,
"$id": "const_17_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -2,15 +2,14 @@
{
"description": "contains keyword validation",
"database": {
"schemas": [
{
"schemas": {
"contains_0_0": {
"contains": {
"minimum": 5
},
"items": true,
"$id": "contains_0_0"
"items": true
}
]
}
},
"tests": [
{
@ -89,15 +88,14 @@
{
"description": "contains keyword with const keyword",
"database": {
"schemas": [
{
"schemas": {
"contains_1_0": {
"contains": {
"const": 5
},
"items": true,
"$id": "contains_1_0"
"items": true
}
]
}
},
"tests": [
{
@ -146,12 +144,11 @@
{
"description": "contains keyword with boolean schema true",
"database": {
"schemas": [
{
"contains": true,
"$id": "contains_2_0"
"schemas": {
"contains_2_0": {
"contains": true
}
]
}
},
"tests": [
{
@ -179,12 +176,11 @@
{
"description": "contains keyword with boolean schema false",
"database": {
"schemas": [
{
"contains": false,
"$id": "contains_3_0"
"schemas": {
"contains_3_0": {
"contains": false
}
]
}
},
"tests": [
{
@ -221,17 +217,16 @@
{
"description": "items + contains",
"database": {
"schemas": [
{
"schemas": {
"contains_4_0": {
"items": {
"multipleOf": 2
},
"contains": {
"multipleOf": 3
},
"$id": "contains_4_0"
}
}
]
}
},
"tests": [
{
@ -289,15 +284,14 @@
{
"description": "contains with false if subschema",
"database": {
"schemas": [
{
"schemas": {
"contains_5_0": {
"contains": {
"if": false,
"else": true
},
"$id": "contains_5_0"
}
}
]
}
},
"tests": [
{
@ -325,14 +319,13 @@
{
"description": "contains with null instance elements",
"database": {
"schemas": [
{
"schemas": {
"contains_6_0": {
"contains": {
"type": "null"
},
"$id": "contains_6_0"
}
}
]
}
},
"tests": [
{
@ -351,15 +344,14 @@
{
"description": "extensible: true allows non-matching items in contains",
"database": {
"schemas": [
{
"schemas": {
"contains_7_0": {
"contains": {
"const": 1
},
"extensible": true,
"$id": "contains_7_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -379,14 +371,13 @@
{
"description": "strict by default: non-matching items in contains are invalid",
"database": {
"schemas": [
{
"schemas": {
"contains_8_0": {
"contains": {
"const": 1
},
"$id": "contains_8_0"
}
}
]
}
},
"tests": [
{

View File

@ -2,12 +2,11 @@
{
"description": "validation of string-encoded content based on media type",
"database": {
"schemas": [
{
"contentMediaType": "application/json",
"$id": "content_0_0"
"schemas": {
"content_0_0": {
"contentMediaType": "application/json"
}
]
}
},
"tests": [
{
@ -42,12 +41,11 @@
{
"description": "validation of binary string-encoding",
"database": {
"schemas": [
{
"contentEncoding": "base64",
"$id": "content_1_0"
"schemas": {
"content_1_0": {
"contentEncoding": "base64"
}
]
}
},
"tests": [
{
@ -82,13 +80,12 @@
{
"description": "validation of binary-encoded media type documents",
"database": {
"schemas": [
{
"schemas": {
"content_2_0": {
"contentMediaType": "application/json",
"contentEncoding": "base64",
"$id": "content_2_0"
"contentEncoding": "base64"
}
]
}
},
"tests": [
{
@ -132,8 +129,8 @@
{
"description": "validation of binary-encoded media type documents with schema",
"database": {
"schemas": [
{
"schemas": {
"content_3_0": {
"contentMediaType": "application/json",
"contentEncoding": "base64",
"contentSchema": {
@ -149,10 +146,9 @@
"type": "integer"
}
}
},
"$id": "content_3_0"
}
}
]
}
},
"tests": [
{

View File

@ -15,9 +15,8 @@
"variations": [
"org"
],
"schemas": [
{
"$id": "full.org",
"schemas": {
"full.org": {
"type": "object",
"properties": {
"missing_users": {
@ -28,7 +27,7 @@
}
}
}
]
}
},
{
"id": "22222222-2222-2222-2222-222222222222",
@ -42,13 +41,12 @@
"variations": [
"user"
],
"schemas": [
{
"$id": "full.user",
"schemas": {
"full.user": {
"type": "object",
"properties": {}
}
]
}
}
],
"relations": []
@ -84,9 +82,8 @@
"variations": [
"parent"
],
"schemas": [
{
"$id": "full.parent",
"schemas": {
"full.parent": {
"type": "object",
"properties": {
"children": {
@ -97,7 +94,7 @@
}
}
}
]
}
},
{
"id": "22222222-2222-2222-2222-222222222222",
@ -111,13 +108,12 @@
"variations": [
"child"
],
"schemas": [
{
"$id": "full.child",
"schemas": {
"full.child": {
"type": "object",
"properties": {}
}
]
}
}
],
"relations": [
@ -167,9 +163,8 @@
"variations": [
"invoice"
],
"schemas": [
{
"$id": "full.invoice",
"schemas": {
"full.invoice": {
"type": "object",
"properties": {
"activities": {
@ -180,7 +175,7 @@
}
}
}
]
}
},
{
"id": "22222222-2222-2222-2222-222222222222",
@ -194,13 +189,12 @@
"variations": [
"activity"
],
"schemas": [
{
"$id": "full.activity",
"schemas": {
"full.activity": {
"type": "object",
"properties": {}
}
]
}
}
],
"relations": [
@ -274,9 +268,8 @@
"variations": [
"actor"
],
"schemas": [
{
"$id": "full.actor",
"schemas": {
"full.actor": {
"type": "object",
"properties": {
"ambiguous_edge": {
@ -287,7 +280,7 @@
}
}
}
]
}
},
{
"id": "22222222-2222-2222-2222-222222222222",
@ -301,13 +294,12 @@
"variations": [
"junction"
],
"schemas": [
{
"$id": "empty.junction",
"schemas": {
"empty.junction": {
"type": "object",
"properties": {}
}
]
}
}
],
"relations": [

View File

@ -2,10 +2,9 @@
{
"description": "single dependency (required)",
"database": {
"schemas": [
{
"schemas": {
"schema1": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema1",
"dependencies": {
"bar": [
"foo"
@ -13,7 +12,7 @@
},
"extensible": true
}
]
}
},
"tests": [
{
@ -93,16 +92,15 @@
{
"description": "empty dependents",
"database": {
"schemas": [
{
"schemas": {
"schema2": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema2",
"dependencies": {
"bar": []
},
"extensible": true
}
]
}
},
"tests": [
{
@ -139,10 +137,9 @@
{
"description": "multiple dependents required",
"database": {
"schemas": [
{
"schemas": {
"schema3": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema3",
"dependencies": {
"quux": [
"foo",
@ -151,7 +148,7 @@
},
"extensible": true
}
]
}
},
"tests": [
{
@ -228,10 +225,9 @@
{
"description": "dependencies with escaped characters",
"database": {
"schemas": [
{
"schemas": {
"schema4": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema4",
"dependencies": {
"foo\nbar": [
"foo\rbar"
@ -242,7 +238,7 @@
},
"extensible": true
}
]
}
},
"tests": [
{
@ -297,10 +293,9 @@
{
"description": "extensible: true allows extra properties in dependentRequired",
"database": {
"schemas": [
{
"schemas": {
"schema5": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema5",
"dependencies": {
"bar": [
"foo"
@ -308,7 +303,7 @@
},
"extensible": true
}
]
}
},
"tests": [
{
@ -329,10 +324,9 @@
{
"description": "single dependency (schemas, STRICT)",
"database": {
"schemas": [
{
"schemas": {
"schema_schema1": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema_schema1",
"properties": {
"foo": true,
"bar": true
@ -350,7 +344,7 @@
}
}
}
]
}
},
"tests": [
{
@ -451,10 +445,9 @@
{
"description": "single dependency (schemas, EXTENSIBLE)",
"database": {
"schemas": [
{
"schemas": {
"schema_schema2": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema_schema2",
"properties": {
"foo": true,
"bar": true
@ -473,7 +466,7 @@
},
"extensible": true
}
]
}
},
"tests": [
{
@ -492,10 +485,9 @@
{
"description": "boolean subschemas",
"database": {
"schemas": [
{
"schemas": {
"schema_schema3": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema_schema3",
"properties": {
"foo": true,
"bar": true
@ -505,7 +497,7 @@
"bar": false
}
}
]
}
},
"tests": [
{
@ -556,10 +548,9 @@
{
"description": "dependencies with escaped characters",
"database": {
"schemas": [
{
"schemas": {
"schema_schema4": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema_schema4",
"properties": {
"foo\tbar": true,
"foo'bar": true,
@ -579,7 +570,7 @@
}
}
}
]
}
},
"tests": [
{
@ -637,10 +628,9 @@
{
"description": "dependent subschema incompatible with root (STRICT)",
"database": {
"schemas": [
{
"schemas": {
"schema_schema5": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema_schema5",
"properties": {
"foo": {},
"baz": true
@ -653,7 +643,7 @@
}
}
}
]
}
},
"tests": [
{
@ -711,10 +701,9 @@
{
"description": "dependent subschema incompatible with root (EXTENSIBLE)",
"database": {
"schemas": [
{
"schemas": {
"schema_schema6": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema_schema6",
"properties": {
"foo": {},
"baz": true
@ -729,7 +718,7 @@
},
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -2,8 +2,8 @@
{
"description": "empty string is valid for all types (except const)",
"database": {
"schemas": [
{
"schemas": {
"emptyString_0_0": {
"properties": {
"obj": {
"type": "object"
@ -36,10 +36,9 @@
"con_empty": {
"const": ""
}
},
"$id": "emptyString_0_0"
}
}
]
}
},
"tests": [
{
@ -142,7 +141,9 @@
"errors": [
{
"code": "CONST_VIOLATED",
"details": { "path": "con" }
"details": {
"path": "con"
}
}
]
}

View File

@ -2,16 +2,15 @@
{
"description": "simple enum validation",
"database": {
"schemas": [
{
"schemas": {
"enum_0_0": {
"enum": [
1,
2,
3
],
"$id": "enum_0_0"
]
}
]
}
},
"tests": [
{
@ -37,8 +36,8 @@
{
"description": "heterogeneous enum validation",
"database": {
"schemas": [
{
"schemas": {
"enum_1_0": {
"enum": [
6,
"foo",
@ -50,10 +49,9 @@
],
"properties": {
"foo": {}
},
"$id": "enum_1_0"
}
}
]
}
},
"tests": [
{
@ -113,15 +111,14 @@
{
"description": "heterogeneous enum-with-null validation",
"database": {
"schemas": [
{
"schemas": {
"enum_2_0": {
"enum": [
6,
null
],
"$id": "enum_2_0"
]
}
]
}
},
"tests": [
{
@ -156,8 +153,8 @@
{
"description": "enums in properties",
"database": {
"schemas": [
{
"schemas": {
"enum_3_0": {
"type": "object",
"properties": {
"foo": {
@ -173,10 +170,9 @@
},
"required": [
"bar"
],
"$id": "enum_3_0"
]
}
]
}
},
"tests": [
{
@ -251,15 +247,14 @@
{
"description": "enum with escaped characters",
"database": {
"schemas": [
{
"schemas": {
"enum_4_0": {
"enum": [
"foo\nbar",
"foo\rbar"
],
"$id": "enum_4_0"
]
}
]
}
},
"tests": [
{
@ -294,14 +289,13 @@
{
"description": "enum with false does not match 0",
"database": {
"schemas": [
{
"schemas": {
"enum_5_0": {
"enum": [
false
],
"$id": "enum_5_0"
]
}
]
}
},
"tests": [
{
@ -336,16 +330,15 @@
{
"description": "enum with [false] does not match [0]",
"database": {
"schemas": [
{
"schemas": {
"enum_6_0": {
"enum": [
[
false
]
],
"$id": "enum_6_0"
]
}
]
}
},
"tests": [
{
@ -386,14 +379,13 @@
{
"description": "enum with true does not match 1",
"database": {
"schemas": [
{
"schemas": {
"enum_7_0": {
"enum": [
true
],
"$id": "enum_7_0"
]
}
]
}
},
"tests": [
{
@ -428,16 +420,15 @@
{
"description": "enum with [true] does not match [1]",
"database": {
"schemas": [
{
"schemas": {
"enum_8_0": {
"enum": [
[
true
]
],
"$id": "enum_8_0"
]
}
]
}
},
"tests": [
{
@ -478,14 +469,13 @@
{
"description": "enum with 0 does not match false",
"database": {
"schemas": [
{
"schemas": {
"enum_9_0": {
"enum": [
0
],
"$id": "enum_9_0"
]
}
]
}
},
"tests": [
{
@ -520,16 +510,15 @@
{
"description": "enum with [0] does not match [false]",
"database": {
"schemas": [
{
"schemas": {
"enum_10_0": {
"enum": [
[
0
]
],
"$id": "enum_10_0"
]
}
]
}
},
"tests": [
{
@ -570,14 +559,13 @@
{
"description": "enum with 1 does not match true",
"database": {
"schemas": [
{
"schemas": {
"enum_11_0": {
"enum": [
1
],
"$id": "enum_11_0"
]
}
]
}
},
"tests": [
{
@ -612,16 +600,15 @@
{
"description": "enum with [1] does not match [true]",
"database": {
"schemas": [
{
"schemas": {
"enum_12_0": {
"enum": [
[
1
]
],
"$id": "enum_12_0"
]
}
]
}
},
"tests": [
{
@ -662,14 +649,13 @@
{
"description": "nul characters in strings",
"database": {
"schemas": [
{
"schemas": {
"enum_13_0": {
"enum": [
"hello\u0000there"
],
"$id": "enum_13_0"
]
}
]
}
},
"tests": [
{
@ -695,17 +681,16 @@
{
"description": "extensible: true allows extra properties in enum object match",
"database": {
"schemas": [
{
"schemas": {
"enum_14_0": {
"enum": [
{
"foo": 1
}
],
"extensible": true,
"$id": "enum_14_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -2,12 +2,11 @@
{
"description": "exclusiveMaximum validation",
"database": {
"schemas": [
{
"exclusiveMaximum": 3,
"$id": "exclusiveMaximum_0_0"
"schemas": {
"exclusiveMaximum_0_0": {
"exclusiveMaximum": 3
}
]
}
},
"tests": [
{

View File

@ -2,12 +2,11 @@
{
"description": "exclusiveMinimum validation",
"database": {
"schemas": [
{
"exclusiveMinimum": 1.1,
"$id": "exclusiveMinimum_0_0"
"schemas": {
"exclusiveMinimum_0_0": {
"exclusiveMinimum": 1.1
}
]
}
},
"tests": [
{

View File

@ -2,12 +2,11 @@
{
"description": "validation of date-time strings",
"database": {
"schemas": [
{
"format": "date-time",
"$id": "format_0_0"
"schemas": {
"format_0_0": {
"format": "date-time"
}
]
}
},
"tests": [
{
@ -249,12 +248,11 @@
{
"description": "validation of date strings",
"database": {
"schemas": [
{
"format": "date",
"$id": "format_1_0"
"schemas": {
"format_1_0": {
"format": "date"
}
]
}
},
"tests": [
{
@ -694,12 +692,11 @@
{
"description": "validation of duration strings",
"database": {
"schemas": [
{
"format": "duration",
"$id": "format_2_0"
"schemas": {
"format_2_0": {
"format": "duration"
}
]
}
},
"tests": [
{
@ -941,12 +938,11 @@
{
"description": "\\a is not an ECMA 262 control escape",
"database": {
"schemas": [
{
"format": "regex",
"$id": "format_3_0"
"schemas": {
"format_3_0": {
"format": "regex"
}
]
}
},
"tests": [
{
@ -963,12 +959,11 @@
{
"description": "validation of e-mail addresses",
"database": {
"schemas": [
{
"format": "email",
"$id": "format_4_0"
"schemas": {
"format_4_0": {
"format": "email"
}
]
}
},
"tests": [
{
@ -1192,12 +1187,11 @@
{
"description": "validation of host names",
"database": {
"schemas": [
{
"format": "hostname",
"$id": "format_5_0"
"schemas": {
"format_5_0": {
"format": "hostname"
}
]
}
},
"tests": [
{
@ -1422,12 +1416,11 @@
{
"description": "validation of A-label (punycode) host names",
"database": {
"schemas": [
{
"format": "hostname",
"$id": "format_6_0"
"schemas": {
"format_6_0": {
"format": "hostname"
}
]
}
},
"tests": [
{
@ -1803,12 +1796,11 @@
{
"description": "validation of an internationalized e-mail addresses",
"database": {
"schemas": [
{
"format": "idn-email",
"$id": "format_7_0"
"schemas": {
"format_7_0": {
"format": "idn-email"
}
]
}
},
"tests": [
{
@ -1906,12 +1898,11 @@
{
"description": "validation of internationalized host names",
"database": {
"schemas": [
{
"format": "idn-hostname",
"$id": "format_8_0"
"schemas": {
"format_8_0": {
"format": "idn-hostname"
}
]
}
},
"tests": [
{
@ -2479,12 +2470,11 @@
}
],
"database": {
"schemas": [
{
"format": "idn-hostname",
"$id": "format_9_0"
"schemas": {
"format_9_0": {
"format": "idn-hostname"
}
]
}
},
"tests": [
{
@ -2672,12 +2662,11 @@
{
"description": "validation of IP addresses",
"database": {
"schemas": [
{
"format": "ipv4",
"$id": "format_10_0"
"schemas": {
"format_10_0": {
"format": "ipv4"
}
]
}
},
"tests": [
{
@ -2830,12 +2819,11 @@
{
"description": "validation of IPv6 addresses",
"database": {
"schemas": [
{
"format": "ipv6",
"$id": "format_11_0"
"schemas": {
"format_11_0": {
"format": "ipv6"
}
]
}
},
"tests": [
{
@ -3203,12 +3191,11 @@
{
"description": "validation of IRI References",
"database": {
"schemas": [
{
"format": "iri-reference",
"$id": "format_12_0"
"schemas": {
"format_12_0": {
"format": "iri-reference"
}
]
}
},
"tests": [
{
@ -3333,12 +3320,11 @@
{
"description": "validation of IRIs",
"database": {
"schemas": [
{
"format": "iri",
"$id": "format_13_0"
"schemas": {
"format_13_0": {
"format": "iri"
}
]
}
},
"tests": [
{
@ -3481,12 +3467,11 @@
{
"description": "validation of JSON-pointers (JSON String Representation)",
"database": {
"schemas": [
{
"format": "json-pointer",
"$id": "format_14_0"
"schemas": {
"format_14_0": {
"format": "json-pointer"
}
]
}
},
"tests": [
{
@ -3836,12 +3821,11 @@
{
"description": "validation of regular expressions",
"database": {
"schemas": [
{
"format": "regex",
"$id": "format_15_0"
"schemas": {
"format_15_0": {
"format": "regex"
}
]
}
},
"tests": [
{
@ -3921,12 +3905,11 @@
{
"description": "validation of Relative JSON Pointers (RJP)",
"database": {
"schemas": [
{
"format": "relative-json-pointer",
"$id": "format_16_0"
"schemas": {
"format_16_0": {
"format": "relative-json-pointer"
}
]
}
},
"tests": [
{
@ -4096,12 +4079,11 @@
{
"description": "validation of time strings",
"database": {
"schemas": [
{
"format": "time",
"$id": "format_17_0"
"schemas": {
"format_17_0": {
"format": "time"
}
]
}
},
"tests": [
{
@ -4523,12 +4505,11 @@
{
"description": "unknown format",
"database": {
"schemas": [
{
"format": "unknown",
"$id": "format_18_0"
"schemas": {
"format_18_0": {
"format": "unknown"
}
]
}
},
"tests": [
{
@ -4599,12 +4580,11 @@
{
"description": "validation of URI References",
"database": {
"schemas": [
{
"format": "uri-reference",
"$id": "format_19_0"
"schemas": {
"format_19_0": {
"format": "uri-reference"
}
]
}
},
"tests": [
{
@ -4747,12 +4727,11 @@
{
"description": "format: uri-template",
"database": {
"schemas": [
{
"format": "uri-template",
"$id": "format_20_0"
"schemas": {
"format_20_0": {
"format": "uri-template"
}
]
}
},
"tests": [
{
@ -4850,12 +4829,11 @@
{
"description": "validation of URIs",
"database": {
"schemas": [
{
"format": "uri",
"$id": "format_21_0"
"schemas": {
"format_21_0": {
"format": "uri"
}
]
}
},
"tests": [
{
@ -5187,12 +5165,11 @@
{
"description": "uuid format",
"database": {
"schemas": [
{
"format": "uuid",
"$id": "format_22_0"
"schemas": {
"format_22_0": {
"format": "uuid"
}
]
}
},
"tests": [
{
@ -5398,12 +5375,11 @@
{
"description": "period format",
"database": {
"schemas": [
{
"format": "period",
"$id": "format_23_0"
"schemas": {
"format_23_0": {
"format": "period"
}
]
}
},
"tests": [
{

View File

@ -5,15 +5,18 @@
"puncs": [
{
"name": "get_invoice",
"schemas": [
{
"$id": "get_invoice.response",
"schemas": {
"get_invoice.response": {
"oneOf": [
{ "type": "invoice" },
{ "type": "null" }
{
"type": "invoice"
},
{
"type": "null"
}
]
}
]
}
}
],
"enums": [],
@ -23,32 +26,64 @@
"type": "relation",
"constraint": "fk_attachment_attachable_entity",
"source_type": "attachment",
"source_columns": ["attachable_id", "attachable_type"],
"source_columns": [
"attachable_id",
"attachable_type"
],
"destination_type": "entity",
"destination_columns": ["id", "type"],
"destination_columns": [
"id",
"type"
],
"prefix": null
}
],
"types": [
{
"name": "entity",
"schemas": [
{
"$id": "entity",
"schemas": {
"entity": {
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid" },
"type": { "type": "string" },
"archived": { "type": "boolean" },
"created_at": { "type": "string", "format": "date-time" }
"id": {
"type": "string",
"format": "uuid"
},
"type": {
"type": "string"
},
"archived": {
"type": "boolean"
},
"created_at": {
"type": "string",
"format": "date-time"
}
}
}
},
"hierarchy": [
"entity"
],
"variations": [
"entity",
"activity",
"invoice",
"attachment"
],
"fields": [
"id",
"type",
"archived",
"created_at"
],
"hierarchy": ["entity"],
"variations": ["entity", "activity", "invoice", "attachment"],
"fields": ["id", "type", "archived", "created_at"],
"grouped_fields": {
"entity": ["id", "type", "archived", "created_at"]
"entity": [
"id",
"type",
"archived",
"created_at"
]
},
"field_types": {
"id": "uuid",
@ -63,21 +98,42 @@
},
{
"name": "activity",
"schemas": [
{
"$id": "activity",
"schemas": {
"activity": {
"type": "entity",
"properties": {
"start_date": { "type": "string", "format": "date-time" }
"start_date": {
"type": "string",
"format": "date-time"
}
}
}
},
"hierarchy": [
"activity",
"entity"
],
"variations": [
"activity",
"invoice"
],
"fields": [
"id",
"type",
"archived",
"created_at",
"start_date"
],
"hierarchy": ["activity", "entity"],
"variations": ["activity", "invoice"],
"fields": ["id", "type", "archived", "created_at", "start_date"],
"grouped_fields": {
"entity": ["id", "type", "archived", "created_at"],
"activity": ["start_date"]
"entity": [
"id",
"type",
"archived",
"created_at"
],
"activity": [
"start_date"
]
},
"field_types": {
"id": "uuid",
@ -93,26 +149,51 @@
},
{
"name": "invoice",
"schemas": [
{
"$id": "invoice",
"schemas": {
"invoice": {
"type": "activity",
"properties": {
"status": { "type": "string" },
"status": {
"type": "string"
},
"attachments": {
"type": "array",
"items": { "type": "attachment" }
"items": {
"type": "attachment"
}
}
}
}
},
"hierarchy": [
"invoice",
"activity",
"entity"
],
"variations": [
"invoice"
],
"fields": [
"id",
"type",
"archived",
"created_at",
"start_date",
"status"
],
"hierarchy": ["invoice", "activity", "entity"],
"variations": ["invoice"],
"fields": ["id", "type", "archived", "created_at", "start_date", "status"],
"grouped_fields": {
"entity": ["id", "type", "archived", "created_at"],
"activity": ["start_date"],
"invoice": ["status"]
"entity": [
"id",
"type",
"archived",
"created_at"
],
"activity": [
"start_date"
],
"invoice": [
"status"
]
},
"field_types": {
"id": "uuid",
@ -129,26 +210,66 @@
},
{
"name": "attachment",
"schemas": [
{
"$id": "attachment",
"schemas": {
"attachment": {
"type": "entity",
"properties": {
"name": { "type": "string" },
"attachable_id": { "type": "string", "format": "uuid" },
"attachable_type": { "type": "string" },
"kind": { "type": "string" },
"file": { "type": "string" },
"data": { "type": "object" }
"name": {
"type": "string"
},
"attachable_id": {
"type": "string",
"format": "uuid"
},
"attachable_type": {
"type": "string"
},
"kind": {
"type": "string"
},
"file": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
},
"hierarchy": [
"attachment",
"entity"
],
"variations": [
"attachment"
],
"fields": [
"id",
"type",
"archived",
"created_at",
"attachable_id",
"attachable_type",
"kind",
"file",
"data",
"name"
],
"hierarchy": ["attachment", "entity"],
"variations": ["attachment"],
"fields": ["id", "type", "archived", "created_at", "attachable_id", "attachable_type", "kind", "file", "data", "name"],
"grouped_fields": {
"entity": ["id", "type", "archived", "created_at"],
"attachment": ["attachable_id", "attachable_type", "kind", "file", "data", "name"]
"entity": [
"id",
"type",
"archived",
"created_at"
],
"attachment": [
"attachable_id",
"attachable_type",
"kind",
"file",
"data",
"name"
]
},
"field_types": {
"id": "uuid",

View File

@ -2,14 +2,13 @@
{
"description": "a schema given for items",
"database": {
"schemas": [
{
"schemas": {
"items_0_0": {
"items": {
"type": "integer"
},
"$id": "items_0_0"
}
}
]
}
},
"tests": [
{
@ -65,12 +64,11 @@
{
"description": "items with boolean schema (true)",
"database": {
"schemas": [
{
"items": true,
"$id": "items_1_0"
"schemas": {
"items_1_0": {
"items": true
}
]
}
},
"tests": [
{
@ -100,12 +98,11 @@
{
"description": "items with boolean schema (false)",
"database": {
"schemas": [
{
"items": false,
"$id": "items_2_0"
"schemas": {
"items_2_0": {
"items": false
}
]
}
},
"tests": [
{
@ -135,8 +132,8 @@
{
"description": "items and subitems",
"database": {
"schemas": [
{
"schemas": {
"items_3_0": {
"type": "array",
"items": false,
"prefixItems": [
@ -149,11 +146,9 @@
{
"type": "item"
}
],
"$id": "items_3_0"
]
},
{
"$id": "item",
"item": {
"type": "array",
"items": false,
"prefixItems": [
@ -165,14 +160,13 @@
}
]
},
{
"$id": "sub-item",
"sub-item": {
"type": "object",
"required": [
"foo"
]
}
]
}
},
"tests": [
{
@ -374,8 +368,8 @@
{
"description": "nested items",
"database": {
"schemas": [
{
"schemas": {
"items_4_0": {
"type": "array",
"items": {
"type": "array",
@ -388,10 +382,9 @@
}
}
}
},
"$id": "items_4_0"
}
}
]
}
},
"tests": [
{
@ -507,17 +500,16 @@
{
"description": "prefixItems with no additional items allowed",
"database": {
"schemas": [
{
"schemas": {
"items_5_0": {
"prefixItems": [
{},
{},
{}
],
"items": false,
"$id": "items_5_0"
"items": false
}
]
}
},
"tests": [
{
@ -584,8 +576,8 @@
{
"description": "items does not look in applicators, valid case",
"database": {
"schemas": [
{
"schemas": {
"items_6_0": {
"allOf": [
{
"prefixItems": [
@ -597,10 +589,9 @@
],
"items": {
"minimum": 5
},
"$id": "items_6_0"
}
}
]
}
},
"tests": [
{
@ -632,8 +623,8 @@
{
"description": "prefixItems validation adjusts the starting index for items",
"database": {
"schemas": [
{
"schemas": {
"items_7_0": {
"prefixItems": [
{
"type": "string"
@ -641,10 +632,9 @@
],
"items": {
"type": "integer"
},
"$id": "items_7_0"
}
}
]
}
},
"tests": [
{
@ -677,15 +667,14 @@
{
"description": "items with heterogeneous array",
"database": {
"schemas": [
{
"schemas": {
"items_8_0": {
"prefixItems": [
{}
],
"items": false,
"$id": "items_8_0"
"items": false
}
]
}
},
"tests": [
{
@ -717,14 +706,13 @@
{
"description": "items with null instance elements",
"database": {
"schemas": [
{
"schemas": {
"items_9_0": {
"items": {
"type": "null"
},
"$id": "items_9_0"
}
}
]
}
},
"tests": [
{
@ -743,13 +731,12 @@
{
"description": "extensible: true allows extra items (when items is false)",
"database": {
"schemas": [
{
"schemas": {
"items_10_0": {
"items": false,
"extensible": true,
"$id": "items_10_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -768,15 +755,14 @@
{
"description": "extensible: true allows extra properties for items",
"database": {
"schemas": [
{
"schemas": {
"items_11_0": {
"items": {
"minimum": 5
},
"extensible": true,
"$id": "items_11_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -807,13 +793,12 @@
{
"description": "array: simple extensible array",
"database": {
"schemas": [
{
"schemas": {
"items_12_0": {
"type": "array",
"extensible": true,
"$id": "items_12_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -842,13 +827,12 @@
{
"description": "array: strict array",
"database": {
"schemas": [
{
"schemas": {
"items_13_0": {
"type": "array",
"extensible": false,
"$id": "items_13_0"
"extensible": false
}
]
}
},
"tests": [
{
@ -876,15 +860,14 @@
{
"description": "array: items extensible",
"database": {
"schemas": [
{
"schemas": {
"items_14_0": {
"type": "array",
"items": {
"extensible": true
},
"$id": "items_14_0"
}
}
]
}
},
"tests": [
{
@ -914,16 +897,15 @@
{
"description": "array: items strict",
"database": {
"schemas": [
{
"schemas": {
"items_15_0": {
"type": "array",
"items": {
"type": "object",
"extensible": false
},
"$id": "items_15_0"
}
}
]
}
},
"tests": [
{

View File

@ -2,13 +2,12 @@
{
"description": "maxContains without contains is ignored",
"database": {
"schemas": [
{
"schemas": {
"maxContains_0_0": {
"maxContains": 1,
"extensible": true,
"$id": "maxContains_0_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -39,16 +38,15 @@
{
"description": "maxContains with contains",
"database": {
"schemas": [
{
"schemas": {
"maxContains_1_0": {
"contains": {
"const": 1
},
"maxContains": 1,
"extensible": true,
"$id": "maxContains_1_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -113,16 +111,15 @@
{
"description": "maxContains with contains, value with a decimal",
"database": {
"schemas": [
{
"schemas": {
"maxContains_2_0": {
"contains": {
"const": 1
},
"maxContains": 1,
"extensible": true,
"$id": "maxContains_2_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -153,17 +150,16 @@
{
"description": "minContains < maxContains",
"database": {
"schemas": [
{
"schemas": {
"maxContains_3_0": {
"contains": {
"const": 1
},
"minContains": 1,
"maxContains": 3,
"extensible": true,
"$id": "maxContains_3_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -206,16 +202,15 @@
{
"description": "extensible: true allows non-matching items in maxContains",
"database": {
"schemas": [
{
"schemas": {
"maxContains_4_0": {
"contains": {
"const": 1
},
"maxContains": 1,
"extensible": true,
"$id": "maxContains_4_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -2,13 +2,12 @@
{
"description": "maxItems validation",
"database": {
"schemas": [
{
"schemas": {
"maxItems_0_0": {
"maxItems": 2,
"extensible": true,
"$id": "maxItems_0_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -61,13 +60,12 @@
{
"description": "maxItems validation with a decimal",
"database": {
"schemas": [
{
"schemas": {
"maxItems_1_0": {
"maxItems": 2,
"extensible": true,
"$id": "maxItems_1_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -99,13 +97,12 @@
{
"description": "extensible: true allows extra items in maxItems (but counted)",
"database": {
"schemas": [
{
"schemas": {
"maxItems_2_0": {
"maxItems": 2,
"extensible": true,
"$id": "maxItems_2_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -2,12 +2,11 @@
{
"description": "maxLength validation",
"database": {
"schemas": [
{
"maxLength": 2,
"$id": "maxLength_0_0"
"schemas": {
"maxLength_0_0": {
"maxLength": 2
}
]
}
},
"tests": [
{
@ -60,12 +59,11 @@
{
"description": "maxLength validation with a decimal",
"database": {
"schemas": [
{
"maxLength": 2,
"$id": "maxLength_1_0"
"schemas": {
"maxLength_1_0": {
"maxLength": 2
}
]
}
},
"tests": [
{

View File

@ -2,13 +2,12 @@
{
"description": "maxProperties validation",
"database": {
"schemas": [
{
"schemas": {
"maxProperties_0_0": {
"maxProperties": 2,
"extensible": true,
"$id": "maxProperties_0_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -83,13 +82,12 @@
{
"description": "maxProperties validation with a decimal",
"database": {
"schemas": [
{
"schemas": {
"maxProperties_1_0": {
"maxProperties": 2,
"extensible": true,
"$id": "maxProperties_1_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -121,13 +119,12 @@
{
"description": "maxProperties = 0 means the object is empty",
"database": {
"schemas": [
{
"schemas": {
"maxProperties_2_0": {
"maxProperties": 0,
"extensible": true,
"$id": "maxProperties_2_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -155,13 +152,12 @@
{
"description": "extensible: true allows extra properties in maxProperties (though maxProperties still counts them!)",
"database": {
"schemas": [
{
"schemas": {
"maxProperties_3_0": {
"maxProperties": 2,
"extensible": true,
"$id": "maxProperties_3_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -2,12 +2,11 @@
{
"description": "maximum validation",
"database": {
"schemas": [
{
"maximum": 3,
"$id": "maximum_0_0"
"schemas": {
"maximum_0_0": {
"maximum": 3
}
]
}
},
"tests": [
{
@ -51,12 +50,11 @@
{
"description": "maximum validation with unsigned integer",
"database": {
"schemas": [
{
"maximum": 300,
"$id": "maximum_1_0"
"schemas": {
"maximum_1_0": {
"maximum": 300
}
]
}
},
"tests": [
{

View File

@ -2,25 +2,23 @@
{
"description": "merging: properties accumulate",
"database": {
"schemas": [
{
"$id": "base_0",
"schemas": {
"base_0": {
"properties": {
"base_prop": {
"type": "string"
}
}
},
{
"merge_0_0": {
"type": "base_0",
"properties": {
"child_prop": {
"type": "string"
}
},
"$id": "merge_0_0"
}
}
]
}
},
"tests": [
{
@ -48,7 +46,9 @@
"errors": [
{
"code": "INVALID_TYPE",
"details": { "path": "base_prop" }
"details": {
"path": "base_prop"
}
}
]
}
@ -58,9 +58,8 @@
{
"description": "merging: required fields accumulate",
"database": {
"schemas": [
{
"$id": "base_1",
"schemas": {
"base_1": {
"properties": {
"a": {
"type": "string"
@ -70,7 +69,7 @@
"a"
]
},
{
"merge_1_0": {
"type": "base_1",
"properties": {
"b": {
@ -79,10 +78,9 @@
},
"required": [
"b"
],
"$id": "merge_1_0"
]
}
]
}
},
"tests": [
{
@ -109,7 +107,9 @@
"errors": [
{
"code": "REQUIRED_FIELD_MISSING",
"details": { "path": "a" }
"details": {
"path": "a"
}
}
]
}
@ -126,7 +126,9 @@
"errors": [
{
"code": "REQUIRED_FIELD_MISSING",
"details": { "path": "b" }
"details": {
"path": "b"
}
}
]
}
@ -136,9 +138,8 @@
{
"description": "merging: dependencies accumulate",
"database": {
"schemas": [
{
"$id": "base_2",
"schemas": {
"base_2": {
"properties": {
"trigger": {
"type": "string"
@ -153,7 +154,7 @@
]
}
},
{
"merge_2_0": {
"type": "base_2",
"properties": {
"child_dep": {
@ -164,10 +165,9 @@
"trigger": [
"child_dep"
]
},
"$id": "merge_2_0"
}
}
]
}
},
"tests": [
{
@ -196,7 +196,9 @@
"errors": [
{
"code": "DEPENDENCY_MISSING",
"details": { "path": "" }
"details": {
"path": ""
}
}
]
}
@ -214,7 +216,9 @@
"errors": [
{
"code": "DEPENDENCY_MISSING",
"details": { "path": "" }
"details": {
"path": ""
}
}
]
}
@ -224,9 +228,8 @@
{
"description": "merging: form and display do NOT merge",
"database": {
"schemas": [
{
"$id": "base_3",
"schemas": {
"base_3": {
"properties": {
"a": {
"type": "string"
@ -240,7 +243,7 @@
"b"
]
},
{
"merge_3_0": {
"type": "base_3",
"properties": {
"c": {
@ -249,10 +252,9 @@
},
"form": [
"c"
],
"$id": "merge_3_0"
]
}
]
}
},
"tests": [
{

File diff suppressed because it is too large Load Diff

View File

@ -2,13 +2,12 @@
{
"description": "minContains without contains is ignored",
"database": {
"schemas": [
{
"schemas": {
"minContains_0_0": {
"minContains": 1,
"extensible": true,
"$id": "minContains_0_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -36,16 +35,15 @@
{
"description": "minContains=1 with contains",
"database": {
"schemas": [
{
"schemas": {
"minContains_1_0": {
"contains": {
"const": 1
},
"minContains": 1,
"extensible": true,
"$id": "minContains_1_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -108,16 +106,15 @@
{
"description": "minContains=2 with contains",
"database": {
"schemas": [
{
"schemas": {
"minContains_2_0": {
"contains": {
"const": 1
},
"minContains": 2,
"extensible": true,
"$id": "minContains_2_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -195,16 +192,15 @@
{
"description": "minContains=2 with contains with a decimal value",
"database": {
"schemas": [
{
"schemas": {
"minContains_3_0": {
"contains": {
"const": 1
},
"minContains": 2,
"extensible": true,
"$id": "minContains_3_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -235,17 +231,16 @@
{
"description": "maxContains = minContains",
"database": {
"schemas": [
{
"schemas": {
"minContains_4_0": {
"contains": {
"const": 1
},
"maxContains": 2,
"minContains": 2,
"extensible": true,
"$id": "minContains_4_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -298,17 +293,16 @@
{
"description": "maxContains < minContains",
"database": {
"schemas": [
{
"schemas": {
"minContains_5_0": {
"contains": {
"const": 1
},
"maxContains": 1,
"minContains": 3,
"extensible": true,
"$id": "minContains_5_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -361,16 +355,15 @@
{
"description": "minContains = 0",
"database": {
"schemas": [
{
"schemas": {
"minContains_6_0": {
"contains": {
"const": 1
},
"minContains": 0,
"extensible": true,
"$id": "minContains_6_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -398,17 +391,16 @@
{
"description": "minContains = 0 with maxContains",
"database": {
"schemas": [
{
"schemas": {
"minContains_7_0": {
"contains": {
"const": 1
},
"minContains": 0,
"maxContains": 1,
"extensible": true,
"$id": "minContains_7_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -448,16 +440,15 @@
{
"description": "extensible: true allows non-matching items in minContains",
"database": {
"schemas": [
{
"schemas": {
"minContains_8_0": {
"contains": {
"const": 1
},
"minContains": 1,
"extensible": true,
"$id": "minContains_8_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -2,13 +2,12 @@
{
"description": "minItems validation",
"database": {
"schemas": [
{
"schemas": {
"minItems_0_0": {
"minItems": 1,
"extensible": true,
"$id": "minItems_0_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -57,13 +56,12 @@
{
"description": "minItems validation with a decimal",
"database": {
"schemas": [
{
"schemas": {
"minItems_1_0": {
"minItems": 1,
"extensible": true,
"$id": "minItems_1_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -92,13 +90,12 @@
{
"description": "extensible: true allows extra items in minItems",
"database": {
"schemas": [
{
"schemas": {
"minItems_2_0": {
"minItems": 1,
"extensible": true,
"$id": "minItems_2_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -2,12 +2,11 @@
{
"description": "minLength validation",
"database": {
"schemas": [
{
"minLength": 2,
"$id": "minLength_0_0"
"schemas": {
"minLength_0_0": {
"minLength": 2
}
]
}
},
"tests": [
{
@ -60,12 +59,11 @@
{
"description": "minLength validation with a decimal",
"database": {
"schemas": [
{
"minLength": 2,
"$id": "minLength_1_0"
"schemas": {
"minLength_1_0": {
"minLength": 2
}
]
}
},
"tests": [
{

View File

@ -2,13 +2,12 @@
{
"description": "minProperties validation",
"database": {
"schemas": [
{
"schemas": {
"minProperties_0_0": {
"minProperties": 1,
"extensible": true,
"$id": "minProperties_0_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -75,13 +74,12 @@
{
"description": "minProperties validation with a decimal",
"database": {
"schemas": [
{
"schemas": {
"minProperties_1_0": {
"minProperties": 1,
"extensible": true,
"$id": "minProperties_1_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -110,13 +108,12 @@
{
"description": "extensible: true allows extra properties in minProperties",
"database": {
"schemas": [
{
"schemas": {
"minProperties_2_0": {
"minProperties": 1,
"extensible": true,
"$id": "minProperties_2_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -2,12 +2,11 @@
{
"description": "minimum validation",
"database": {
"schemas": [
{
"minimum": 1.1,
"$id": "minimum_0_0"
"schemas": {
"minimum_0_0": {
"minimum": 1.1
}
]
}
},
"tests": [
{
@ -51,12 +50,11 @@
{
"description": "minimum validation with signed integer",
"database": {
"schemas": [
{
"minimum": -2,
"$id": "minimum_1_0"
"schemas": {
"minimum_1_0": {
"minimum": -2
}
]
}
},
"tests": [
{

View File

@ -2,12 +2,11 @@
{
"description": "by int",
"database": {
"schemas": [
{
"multipleOf": 2,
"$id": "multipleOf_0_0"
"schemas": {
"multipleOf_0_0": {
"multipleOf": 2
}
]
}
},
"tests": [
{
@ -42,12 +41,11 @@
{
"description": "by number",
"database": {
"schemas": [
{
"multipleOf": 1.5,
"$id": "multipleOf_1_0"
"schemas": {
"multipleOf_1_0": {
"multipleOf": 1.5
}
]
}
},
"tests": [
{
@ -82,12 +80,11 @@
{
"description": "by small number",
"database": {
"schemas": [
{
"multipleOf": 0.0001,
"$id": "multipleOf_2_0"
"schemas": {
"multipleOf_2_0": {
"multipleOf": 0.0001
}
]
}
},
"tests": [
{
@ -113,13 +110,12 @@
{
"description": "small multiple of large integer",
"database": {
"schemas": [
{
"schemas": {
"multipleOf_3_0": {
"type": "integer",
"multipleOf": 1e-8,
"$id": "multipleOf_3_0"
"multipleOf": 1e-08
}
]
}
},
"tests": [
{

View File

@ -2,14 +2,13 @@
{
"description": "not",
"database": {
"schemas": [
{
"schemas": {
"not_0_0": {
"not": {
"type": "integer"
},
"$id": "not_0_0"
}
}
]
}
},
"tests": [
{
@ -35,17 +34,16 @@
{
"description": "not multiple types",
"database": {
"schemas": [
{
"schemas": {
"not_1_0": {
"not": {
"type": [
"integer",
"boolean"
]
},
"$id": "not_1_0"
}
}
]
}
},
"tests": [
{
@ -80,8 +78,8 @@
{
"description": "not more complex schema",
"database": {
"schemas": [
{
"schemas": {
"not_2_0": {
"not": {
"type": "object",
"properties": {
@ -90,10 +88,9 @@
}
}
},
"extensible": true,
"$id": "not_2_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -132,16 +129,15 @@
{
"description": "forbidden property",
"database": {
"schemas": [
{
"schemas": {
"not_3_0": {
"properties": {
"foo": {
"not": {}
}
},
"$id": "not_3_0"
}
}
]
}
},
"tests": [
{
@ -170,12 +166,11 @@
{
"description": "forbid everything with empty schema",
"database": {
"schemas": [
{
"not": {},
"$id": "not_4_0"
"schemas": {
"not_4_0": {
"not": {}
}
]
}
},
"tests": [
{
@ -268,12 +263,11 @@
{
"description": "forbid everything with boolean schema true",
"database": {
"schemas": [
{
"not": true,
"$id": "not_5_0"
"schemas": {
"not_5_0": {
"not": true
}
]
}
},
"tests": [
{
@ -366,13 +360,12 @@
{
"description": "allow everything with boolean schema false",
"database": {
"schemas": [
{
"schemas": {
"not_6_0": {
"not": false,
"extensible": true,
"$id": "not_6_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -465,14 +458,13 @@
{
"description": "double negation",
"database": {
"schemas": [
{
"schemas": {
"not_7_0": {
"not": {
"not": {}
},
"$id": "not_7_0"
}
}
]
}
},
"tests": [
{
@ -489,15 +481,14 @@
{
"description": "extensible: true allows extra properties in not",
"database": {
"schemas": [
{
"schemas": {
"not_8_0": {
"not": {
"type": "integer"
},
"extensible": true,
"$id": "not_8_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -516,14 +507,13 @@
{
"description": "extensible: false (default) forbids extra properties in not",
"database": {
"schemas": [
{
"schemas": {
"not_9_0": {
"not": {
"type": "integer"
},
"$id": "not_9_0"
}
}
]
}
},
"tests": [
{
@ -542,8 +532,8 @@
{
"description": "property next to not (extensible: true)",
"database": {
"schemas": [
{
"schemas": {
"not_10_0": {
"properties": {
"bar": {
"type": "string"
@ -552,10 +542,9 @@
"not": {
"type": "integer"
},
"extensible": true,
"$id": "not_10_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -575,8 +564,8 @@
{
"description": "property next to not (extensible: false)",
"database": {
"schemas": [
{
"schemas": {
"not_11_0": {
"properties": {
"bar": {
"type": "string"
@ -584,10 +573,9 @@
},
"not": {
"type": "integer"
},
"$id": "not_11_0"
}
}
]
}
},
"tests": [
{

View File

@ -2,166 +2,182 @@
{
"description": "Strict Inheritance",
"database": {
"schemas": [
{
"$id": "parent_type",
"schemas": {
"parent_type": {
"type": "object",
"properties": {"a": {"type": "integer"}},
"required": ["a"]
"properties": {
"a": {
"type": "integer"
}
},
"required": [
"a"
]
},
{
"$id": "child_type",
"child_type": {
"type": "parent_type",
"properties": {"b": {"type": "integer"}}
"properties": {
"b": {
"type": "integer"
}
}
}
]
}
},
"tests": [
{
"description": "valid child inherits properties and strictness",
"schema_id": "child_type",
"data": {"a": 1, "b": 2},
"data": {
"a": 1,
"b": 2
},
"action": "validate",
"expect": {"success": true}
"expect": {
"success": true
}
},
{
"description": "missing inherited required property fails",
"schema_id": "child_type",
"data": {"b": 2},
"data": {
"b": 2
},
"action": "validate",
"expect": {"success": false}
"expect": {
"success": false
}
},
{
"description": "additional properties fail due to inherited strictness",
"schema_id": "child_type",
"data": {"a": 1, "b": 2, "c": 3},
"data": {
"a": 1,
"b": 2,
"c": 3
},
"action": "validate",
"expect": {"success": false}
"expect": {
"success": false
}
}
]
},
{
"description": "Local Shadowing (Composition & Proxies)",
"database": {
"schemas": [
{
"$id": "budget",
"schemas": {
"budget": {
"type": "object",
"properties": {
"max": {"type": "integer", "maximum": 100}
"max": {
"type": "integer",
"maximum": 100
}
}
},
{
"$id": "custom_budget",
"custom_budget": {
"type": "budget",
"properties": {
"max": {"type": "integer", "maximum": 50}
"max": {
"type": "integer",
"maximum": 50
}
}
}
]
}
},
"tests": [
{
"description": "shadowing override applies (50 is locally allowed)",
"schema_id": "custom_budget",
"data": {"max": 40},
"data": {
"max": 40
},
"action": "validate",
"expect": {"success": true}
"expect": {
"success": true
}
},
{
"description": "shadowing override applies natively, rejecting 60 even though parent allowed 100",
"schema_id": "custom_budget",
"data": {"max": 60},
"data": {
"max": 60
},
"action": "validate",
"expect": {"success": false}
}
]
},
{
"description": "Inline id Resolution",
"database": {
"schemas": [
{
"$id": "api.request",
"type": "object",
"properties": {
"inline_obj": {
"$id": "inline_nested",
"type": "object",
"properties": {"foo": {"type": "string"}},
"required": ["foo"]
},
"proxy_obj": {
"type": "inline_nested"
}
}
"expect": {
"success": false
}
]
},
"tests": [
{
"description": "proxy resolves and validates to the inline component",
"schema_id": "api.request",
"data": {
"inline_obj": {"foo": "bar"},
"proxy_obj": {"foo": "baz"}
},
"action": "validate",
"expect": {"success": true}
},
{
"description": "proxy resolves and catches violation targeting inline component constraints",
"schema_id": "api.request",
"data": {
"inline_obj": {"foo": "bar"},
"proxy_obj": {}
},
"action": "validate",
"expect": {"success": false}
}
]
},
{
"description": "Primitive Array Shorthand (Optionality)",
"database": {
"schemas": [
{
"$id": "invoice",
"type": "object",
"properties": {"amount": {"type": "integer"}},
"required": ["amount"]
},
{
"$id": "request",
"schemas": {
"invoice": {
"type": "object",
"properties": {
"inv": {"type": ["invoice", "null"]}
"amount": {
"type": "integer"
}
},
"required": [
"amount"
]
},
"request": {
"type": "object",
"properties": {
"inv": {
"type": [
"invoice",
"null"
]
}
}
}
]
}
},
"tests": [
{
"description": "valid object passes shorthand inheritance check",
"schema_id": "request",
"data": {"inv": {"amount": 5}},
"data": {
"inv": {
"amount": 5
}
},
"action": "validate",
"expect": {"success": true}
"expect": {
"success": true
}
},
{
"description": "null passes shorthand inheritance check",
"schema_id": "request",
"data": {"inv": null},
"data": {
"inv": null
},
"action": "validate",
"expect": {"success": true}
"expect": {
"success": true
}
},
{
"description": "invalid object fails inner constraints safely",
"schema_id": "request",
"data": {"inv": {"amount": "string"}},
"data": {
"inv": {
"amount": "string"
}
},
"action": "validate",
"expect": {"success": false}
"expect": {
"success": false
}
}
]
}
]
]

View File

@ -2,9 +2,8 @@
{
"description": "Hybrid Array Pathing",
"database": {
"schemas": [
{
"$id": "hybrid_pathing",
"schemas": {
"hybrid_pathing": {
"type": "object",
"properties": {
"primitives": {
@ -69,7 +68,7 @@
}
}
}
]
}
},
"tests": [
{
@ -123,7 +122,9 @@
"errors": [
{
"code": "INVALID_TYPE",
"details": { "path": "primitives/1" }
"details": {
"path": "primitives/1"
}
}
]
}
@ -147,11 +148,15 @@
"errors": [
{
"code": "REQUIRED_FIELD_MISSING",
"details": { "path": "ad_hoc_objects/1/name" }
"details": {
"path": "ad_hoc_objects/1/name"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"details": { "path": "ad_hoc_objects/1/age" }
"details": {
"path": "ad_hoc_objects/1/age"
}
}
]
}
@ -177,7 +182,9 @@
"errors": [
{
"code": "MINIMUM_VIOLATED",
"details": { "path": "entities/entity-beta/value" }
"details": {
"path": "entities/entity-beta/value"
}
}
]
}
@ -208,7 +215,9 @@
"errors": [
{
"code": "INVALID_TYPE",
"details": { "path": "deep_entities/parent-omega/nested/child-beta/flag" }
"details": {
"path": "deep_entities/parent-omega/nested/child-beta/flag"
}
}
]
}
@ -216,43 +225,10 @@
]
},
{
"description": "Polymorphic Structure Pathing",
"description": "Ad-Hoc Union Pathing",
"database": {
"types": [
{
"name": "widget",
"variations": ["widget"],
"schemas": [
{
"$id": "widget",
"type": "object",
"properties": {
"id": { "type": "string" },
"type": { "type": "string" }
}
},
{
"$id": "stock.widget",
"type": "widget",
"properties": {
"kind": { "type": "string" },
"amount": { "type": "integer" },
"details": {
"type": "object",
"properties": {
"nested_metric": { "type": "number" }
},
"required": ["nested_metric"]
}
},
"required": ["amount", "details"]
}
]
}
],
"schemas": [
{
"$id": "polymorphic_pathing",
"schemas": {
"ad_hoc_pathing": {
"type": "object",
"properties": {
"metadata_bubbles": {
@ -260,26 +236,98 @@
"items": {
"oneOf": [
{
"$id": "contact_metadata",
"type": "object",
"properties": {
"type": { "const": "contact" },
"phone": { "type": "string" }
},
"required": ["phone"]
"type": "string"
},
{
"$id": "invoice_metadata",
"type": "object",
"properties": {
"type": { "const": "invoice" },
"invoice_id": { "type": "integer" }
},
"required": ["invoice_id"]
"type": "integer"
}
]
}
}
}
}
}
},
"tests": [
{
"description": "oneOf arrays natively support disjoint primitive types dynamically mapped into topological paths natively",
"data": {
"metadata_bubbles": [
100,
"metadata string",
true
]
},
"schema_id": "ad_hoc_pathing",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "NO_ONEOF_MATCH",
"details": {
"path": "metadata_bubbles/2"
}
}
]
}
}
]
},
{
"description": "Polymorphic Family Pathing",
"database": {
"types": [
{
"name": "widget",
"variations": [
"widget"
],
"schemas": {
"widget": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"stock.widget": {
"type": "widget",
"properties": {
"kind": {
"type": "string"
},
"amount": {
"type": "integer"
},
"details": {
"type": "object",
"properties": {
"nested_metric": {
"type": "number"
}
},
"required": [
"nested_metric"
]
}
},
"required": [
"amount",
"details"
]
}
}
}
],
"schemas": {
"family_pathing": {
"type": "object",
"properties": {
"table_families": {
"type": "array",
"items": {
@ -288,33 +336,10 @@
}
}
}
]
}
},
"tests": [
{
"description": "oneOf tags natively bubble specific schema paths into deep array roots",
"data": {
"metadata_bubbles": [
{ "type": "invoice", "invoice_id": 100 },
{ "type": "contact", "phone": 12345, "rogue_field": "x" }
]
},
"schema_id": "polymorphic_pathing",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "INVALID_TYPE",
"details": { "path": "metadata_bubbles/1/phone" }
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"details": { "path": "metadata_bubbles/1/rogue_field" }
}
]
}
},
{
"description": "families mechanically map physical variants directly onto topological uuid array paths",
"data": {
@ -324,7 +349,9 @@
"type": "widget",
"kind": "stock",
"amount": 500,
"details": { "nested_metric": 42.0 }
"details": {
"nested_metric": 42.0
}
},
{
"id": "widget-2",
@ -332,32 +359,40 @@
"kind": "stock",
"amount": "not_an_int",
"details": {
"stray_child": true
"stray_child": true
},
"unexpected_root_prop": "hi"
}
]
},
"schema_id": "polymorphic_pathing",
"schema_id": "family_pathing",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "INVALID_TYPE",
"details": { "path": "table_families/widget-2/amount" }
"details": {
"path": "table_families/widget-2/amount"
}
},
{
"code": "REQUIRED_FIELD_MISSING",
"details": { "path": "table_families/widget-2/details/nested_metric" }
"details": {
"path": "table_families/widget-2/details/nested_metric"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"details": { "path": "table_families/widget-2/details/stray_child" }
"details": {
"path": "table_families/widget-2/details/stray_child"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"details": { "path": "table_families/widget-2/unexpected_root_prop" }
"details": {
"path": "table_families/widget-2/unexpected_root_prop"
}
}
]
}

View File

@ -2,12 +2,11 @@
{
"description": "pattern validation",
"database": {
"schemas": [
{
"pattern": "^a*$",
"$id": "pattern_0_0"
"schemas": {
"pattern_0_0": {
"pattern": "^a*$"
}
]
}
},
"tests": [
{
@ -87,12 +86,11 @@
{
"description": "pattern is not anchored",
"database": {
"schemas": [
{
"pattern": "a+",
"$id": "pattern_1_0"
"schemas": {
"pattern_1_0": {
"pattern": "a+"
}
]
}
},
"tests": [
{

View File

@ -2,17 +2,16 @@
{
"description": "patternProperties validates properties matching a regex",
"database": {
"schemas": [
{
"schemas": {
"patternProperties_0_0": {
"patternProperties": {
"f.*o": {
"type": "integer"
}
},
"items": {},
"$id": "patternProperties_0_0"
"items": {}
}
]
}
},
"tests": [
{
@ -108,8 +107,8 @@
{
"description": "multiple simultaneous patternProperties are validated",
"database": {
"schemas": [
{
"schemas": {
"patternProperties_1_0": {
"patternProperties": {
"a*": {
"type": "integer"
@ -117,10 +116,9 @@
"aaa*": {
"maximum": 20
}
},
"$id": "patternProperties_1_0"
}
}
]
}
},
"tests": [
{
@ -196,8 +194,8 @@
{
"description": "regexes are not anchored by default and are case sensitive",
"database": {
"schemas": [
{
"schemas": {
"patternProperties_2_0": {
"patternProperties": {
"[0-9]{2,}": {
"type": "boolean"
@ -206,10 +204,9 @@
"type": "string"
}
},
"extensible": true,
"$id": "patternProperties_2_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -261,15 +258,14 @@
{
"description": "patternProperties with boolean schemas",
"database": {
"schemas": [
{
"schemas": {
"patternProperties_3_0": {
"patternProperties": {
"f.*": true,
"b.*": false
},
"$id": "patternProperties_3_0"
}
}
]
}
},
"tests": [
{
@ -331,16 +327,15 @@
{
"description": "patternProperties with null valued instance properties",
"database": {
"schemas": [
{
"schemas": {
"patternProperties_4_0": {
"patternProperties": {
"^.*bar$": {
"type": "null"
}
},
"$id": "patternProperties_4_0"
}
}
]
}
},
"tests": [
{
@ -359,17 +354,16 @@
{
"description": "extensible: true allows extra properties NOT matching pattern",
"database": {
"schemas": [
{
"schemas": {
"patternProperties_5_0": {
"patternProperties": {
"f.*o": {
"type": "integer"
}
},
"extensible": true,
"$id": "patternProperties_5_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -5,93 +5,147 @@
"types": [
{
"name": "entity",
"variations": ["entity", "organization", "person", "bot"],
"schemas": [
{
"$id": "entity",
"variations": [
"entity",
"organization",
"person",
"bot"
],
"schemas": {
"entity": {
"type": "object",
"properties": {
"type": { "type": "string" },
"id": { "type": "string" }
"type": {
"type": "string"
},
"id": {
"type": "string"
}
}
}
]
}
},
{
"name": "organization",
"variations": ["organization", "person"],
"schemas": [
{
"$id": "organization",
"variations": [
"organization",
"person"
],
"schemas": {
"organization": {
"type": "entity",
"properties": {
"name": { "type": "string" }
"name": {
"type": "string"
}
}
}
]
}
},
{
"name": "person",
"variations": ["person"],
"schemas": [
{
"$id": "person",
"variations": [
"person"
],
"schemas": {
"person": {
"type": "organization",
"properties": {
"first_name": { "type": "string" }
"first_name": {
"type": "string"
}
}
}
]
}
},
{
"name": "bot",
"variations": ["bot"],
"schemas": [
{
"$id": "bot",
"variations": [
"bot"
],
"schemas": {
"bot": {
"type": "entity",
"properties": {
"model": { "type": "string" }
"model": {
"type": "string"
}
}
}
]
}
}
],
"schemas": [
{
"$id": "family_entity",
"schemas": {
"family_entity": {
"$family": "entity"
}
]
}
},
"tests": [
{
"description": "Matches base entity",
"schema_id": "family_entity",
"data": { "type": "entity", "id": "1" },
"data": {
"type": "entity",
"id": "1"
},
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "Matches descendant person natively",
"schema_id": "family_entity",
"data": { "type": "person", "id": "2", "first_name": "Bob" },
"data": {
"type": "person",
"id": "2",
"first_name": "Bob"
},
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "Missing type fails out immediately",
"schema_id": "family_entity",
"data": { "id": "3", "first_name": "Bob" },
"data": {
"id": "3",
"first_name": "Bob"
},
"action": "validate",
"expect": { "success": false, "errors": [ { "code": "MISSING_TYPE", "details": { "path": "" } } ] }
"expect": {
"success": false,
"errors": [
{
"code": "MISSING_TYPE",
"details": {
"path": ""
}
}
]
}
},
{
"description": "Alias matching failure",
"schema_id": "family_entity",
"data": { "type": "alien", "id": "4" },
"data": {
"type": "alien",
"id": "4"
},
"action": "validate",
"expect": { "success": false, "errors": [ { "code": "NO_FAMILY_MATCH", "details": { "path": "" } } ] }
"expect": {
"success": false,
"errors": [
{
"code": "NO_FAMILY_MATCH",
"details": {
"path": ""
}
}
]
}
}
]
},
@ -101,95 +155,125 @@
"types": [
{
"name": "entity",
"variations": ["entity", "organization", "person", "bot"],
"schemas": [
{
"$id": "entity",
"variations": [
"entity",
"organization",
"person",
"bot"
],
"schemas": {
"entity": {
"type": "object",
"properties": {
"type": { "type": "string" }
"type": {
"type": "string"
}
}
},
{
"$id": "light.entity",
"light.entity": {
"type": "entity",
"properties": {
"kind": { "type": "string" }
"kind": {
"type": "string"
}
}
}
]
}
},
{
"name": "organization",
"variations": ["organization", "person"],
"schemas": [
{
"$id": "organization",
"variations": [
"organization",
"person"
],
"schemas": {
"organization": {
"type": "entity"
},
{
"$id": "light.organization",
"light.organization": {
"type": "light.entity"
}
]
}
},
{
"name": "person",
"variations": ["person"],
"schemas": [
{
"$id": "person",
"variations": [
"person"
],
"schemas": {
"person": {
"type": "organization"
},
{
"$id": "light.person",
"light.person": {
"type": "light.organization"
}
]
}
},
{
"name": "bot",
"variations": ["bot"],
"schemas": [
{
"$id": "bot",
"variations": [
"bot"
],
"schemas": {
"bot": {
"type": "entity"
},
{
"$id": "light.bot",
"light.bot": {
"type": "light.entity"
}
]
}
}
],
"schemas": [
{
"$id": "family_light_org",
"schemas": {
"family_light_org": {
"$family": "light.organization"
}
]
}
},
"tests": [
{
"description": "Matches light.organization exact matrix target",
"schema_id": "family_light_org",
"data": { "type": "organization", "kind": "light" },
"data": {
"type": "organization",
"kind": "light"
},
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "Matches descendant light.person through matrix evaluation",
"schema_id": "family_light_org",
"data": { "type": "person", "kind": "light" },
"data": {
"type": "person",
"kind": "light"
},
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "Structurally fails to route bot (bot is not descendant of organization)",
"schema_id": "family_light_org",
"data": { "type": "bot", "kind": "light" },
"data": {
"type": "bot",
"kind": "light"
},
"action": "validate",
"expect": { "success": false, "errors": [ { "code": "NO_FAMILY_MATCH", "details": { "path": "" } } ] }
"expect": {
"success": false,
"errors": [
{
"code": "NO_FAMILY_MATCH",
"details": {
"path": ""
}
}
]
}
}
]
},
@ -199,72 +283,112 @@
"types": [
{
"name": "widget",
"variations": ["widget"],
"schemas": [
{
"$id": "widget",
"variations": [
"widget"
],
"schemas": {
"widget": {
"type": "object",
"properties": {
"type": { "type": "string" }
"type": {
"type": "string"
}
}
},
{
"$id": "stock.widget",
"stock.widget": {
"type": "widget",
"properties": {
"kind": { "type": "string" },
"amount": { "type": "integer" }
"kind": {
"type": "string"
},
"amount": {
"type": "integer"
}
}
},
{
"$id": "super_stock.widget",
"super_stock.widget": {
"type": "stock.widget",
"properties": {
"super_amount": { "type": "integer" }
"super_amount": {
"type": "integer"
}
}
}
]
}
}
],
"schemas": [
{
"$id": "family_widget",
"schemas": {
"family_widget": {
"$family": "widget"
},
{
"$id": "family_stock_widget",
"family_stock_widget": {
"$family": "stock.widget"
}
]
}
},
"tests": [
{
"description": "Base widget resolves stock widget horizontally",
"schema_id": "family_widget",
"data": { "type": "widget", "kind": "stock", "amount": 5 },
"data": {
"type": "widget",
"kind": "stock",
"amount": 5
},
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "Base widget resolves nested super stock widget natively via descendants crawl",
"schema_id": "family_widget",
"data": { "type": "widget", "kind": "super_stock", "amount": 5, "super_amount": 10 },
"data": {
"type": "widget",
"kind": "super_stock",
"amount": 5,
"super_amount": 10
},
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "stock.widget explicit family resolves nested super stock via fast path",
"schema_id": "family_stock_widget",
"data": { "type": "widget", "kind": "super_stock", "amount": 5, "super_amount": 10 },
"data": {
"type": "widget",
"kind": "super_stock",
"amount": 5,
"super_amount": 10
},
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "stock.widget fails when presented an invalid payload constraint",
"schema_id": "family_stock_widget",
"data": { "type": "widget", "kind": "super_stock", "amount": 5, "super_amount": "not_an_int" },
"data": {
"type": "widget",
"kind": "super_stock",
"amount": 5,
"super_amount": "not_an_int"
},
"action": "validate",
"expect": { "success": false, "errors": [ { "code": "INVALID_TYPE", "details": { "path": "super_amount" } } ] }
"expect": {
"success": false,
"errors": [
{
"code": "INVALID_TYPE",
"details": {
"path": "super_amount"
}
}
]
}
}
]
},
@ -274,212 +398,241 @@
"types": [
{
"name": "entity",
"variations": ["entity", "person", "bot"],
"schemas": [
{
"$id": "entity",
"variations": [
"entity",
"person",
"bot"
],
"schemas": {
"entity": {
"type": "object",
"properties": {
"type": { "type": "string" }
"type": {
"type": "string"
}
}
}
]
}
},
{
"name": "person",
"variations": ["person"],
"schemas": [
{
"$id": "person",
"variations": [
"person"
],
"schemas": {
"person": {
"type": "entity"
},
{
"$id": "full.person",
"full.person": {
"type": "person",
"properties": {
"kind": { "type": "string" },
"age": { "type": "integer" }
"kind": {
"type": "string"
},
"age": {
"type": "integer"
}
},
"required": ["age"]
"required": [
"age"
]
}
]
}
},
{
"name": "bot",
"variations": ["bot"],
"schemas": [
{
"$id": "bot",
"variations": [
"bot"
],
"schemas": {
"bot": {
"type": "entity"
},
{
"$id": "full.bot",
"full.bot": {
"type": "bot",
"properties": {
"kind": { "type": "string" },
"version": { "type": "string" }
"kind": {
"type": "string"
},
"version": {
"type": "string"
}
},
"required": ["version"]
"required": [
"version"
]
}
}
}
],
"schemas": {
"oneOf_union": {
"oneOf": [
{
"type": "full.person"
},
{
"type": "full.bot"
}
]
}
],
"schemas": [
{
"$id": "oneOf_union",
"oneOf": [
{ "type": "full.person" },
{ "type": "full.bot" }
]
}
]
}
},
"tests": [
{
"description": "Throws MISSING_TYPE if discriminator matches neither",
"schema_id": "oneOf_union",
"data": { "kind": "full", "age": 5 },
"data": {
"kind": "full",
"age": 5
},
"action": "validate",
"expect": { "success": false, "errors": [ { "code": "MISSING_TYPE", "details": { "path": "" } } ] }
"expect": {
"success": false,
"errors": [
{
"code": "MISSING_TYPE",
"details": {
"path": ""
}
}
]
}
},
{
"description": "Golden match throws pure structural error exclusively on person",
"schema_id": "oneOf_union",
"data": { "type": "person", "kind": "full", "age": "five" },
"data": {
"type": "person",
"kind": "full",
"age": "five"
},
"action": "validate",
"expect": { "success": false, "errors": [ { "code": "INVALID_TYPE", "details": { "path": "age" } } ] }
"expect": {
"success": false,
"errors": [
{
"code": "INVALID_TYPE",
"details": {
"path": "age"
}
}
]
}
},
{
"description": "Golden matches perfectly",
"schema_id": "oneOf_union",
"data": { "type": "person", "kind": "full", "age": 5 },
"data": {
"type": "person",
"kind": "full",
"age": 5
},
"action": "validate",
"expect": { "success": true }
"expect": {
"success": true
}
},
{
"description": "Fails nicely with NO_ONEOF_MATCH",
"schema_id": "oneOf_union",
"data": { "type": "alien", "kind": "full", "age": 5 },
"data": {
"type": "alien",
"kind": "full",
"age": 5
},
"action": "validate",
"expect": { "success": false, "errors": [ { "code": "NO_ONEOF_MATCH", "details": { "path": "" } } ] }
"expect": {
"success": false,
"errors": [
{
"code": "NO_ONEOF_MATCH",
"details": {
"path": ""
}
}
]
}
}
]
},
{
"description": "JSONB Field Bubble oneOf Discrimination (Promoted IDs)",
"database": {
"schemas": [
{
"$id": "metadata",
"schemas": {
"metadata": {
"type": "object",
"properties": {
"type": { "type": "string" }
"type": {
"type": "string"
}
}
},
{
"$id": "invoice.metadata",
"invoice.metadata": {
"type": "metadata",
"properties": {
"invoice_id": { "type": "integer" }
"invoice_id": {
"type": "integer"
}
},
"required": ["invoice_id"]
"required": [
"invoice_id"
]
},
{
"$id": "payment.metadata",
"payment.metadata": {
"type": "metadata",
"properties": {
"payment_id": { "type": "integer" }
"payment_id": {
"type": "integer"
}
},
"required": ["payment_id"]
"required": [
"payment_id"
]
},
{
"$id": "oneOf_bubble",
"oneOf_bubble": {
"oneOf": [
{ "type": "invoice.metadata" },
{ "type": "payment.metadata" }
{
"type": "invoice.metadata"
},
{
"type": "payment.metadata"
}
]
}
]
}
},
"tests": [
{
"description": "Extracts golden match natively from explicit JSONB type discriminator",
"schema_id": "oneOf_bubble",
"data": { "type": "invoice.metadata", "invoice_id": "nan" },
"data": {
"type": "invoice.metadata",
"invoice_id": "nan"
},
"action": "validate",
"expect": {
"success": false,
"errors": [ { "code": "INVALID_TYPE", "details": { "path": "invoice_id" } } ]
"errors": [
{
"code": "INVALID_TYPE",
"details": {
"path": "invoice_id"
}
}
]
}
},
{
"description": "Valid payload succeeds perfectly in JSONB universe",
"schema_id": "oneOf_bubble",
"data": { "type": "payment.metadata", "payment_id": 123 },
"action": "validate",
"expect": { "success": true }
}
]
},
{
"description": "Standard JSON Schema oneOf",
"database": {
"schemas": [
{
"$id": "oneOf_scalars",
"oneOf": [
{ "type": "integer" },
{ "minimum": 2 }
]
"data": {
"type": "payment.metadata",
"payment_id": 123
},
{
"$id": "oneOf_dedupe",
"oneOf": [
{
"type": "object",
"properties": {
"shared": { "type": "integer" }
},
"required": ["shared"]
},
{
"type": "object",
"properties": {
"shared": { "type": "integer" },
"extra": { "type": "string" }
},
"required": ["shared", "extra"]
}
]
}
]
},
"tests": [
{
"description": "Valid exclusively against first scalar choice",
"schema_id": "oneOf_scalars",
"data": 1,
"action": "validate",
"expect": { "success": true }
},
{
"description": "Fails mathematically if matches both schemas natively",
"schema_id": "oneOf_scalars",
"data": 3,
"action": "validate",
"expect": { "success": false }
},
{
"description": "Deduper merges shared errors dynamically exactly like JSON Schema",
"schema_id": "oneOf_dedupe",
"data": { "shared": "nan" },
"action": "validate",
"expect": {
"success": false,
"errors": [
{ "code": "NO_ONEOF_MATCH", "details": { "path": "" } },
{ "code": "INVALID_TYPE", "details": { "path": "shared" } }
]
"success": true
}
}
]

View File

@ -2,8 +2,8 @@
{
"description": "a schema given for prefixItems",
"database": {
"schemas": [
{
"schemas": {
"prefixItems_0_0": {
"prefixItems": [
{
"type": "integer"
@ -11,10 +11,9 @@
{
"type": "string"
}
],
"$id": "prefixItems_0_0"
]
}
]
}
},
"tests": [
{
@ -92,15 +91,14 @@
{
"description": "prefixItems with boolean schemas",
"database": {
"schemas": [
{
"schemas": {
"prefixItems_1_0": {
"prefixItems": [
true,
false
],
"$id": "prefixItems_1_0"
]
}
]
}
},
"tests": [
{
@ -140,17 +138,16 @@
{
"description": "additional items are allowed by default",
"database": {
"schemas": [
{
"schemas": {
"prefixItems_2_0": {
"prefixItems": [
{
"type": "integer"
}
],
"extensible": true,
"$id": "prefixItems_2_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -171,16 +168,15 @@
{
"description": "prefixItems with null instance elements",
"database": {
"schemas": [
{
"schemas": {
"prefixItems_3_0": {
"prefixItems": [
{
"type": "null"
}
],
"$id": "prefixItems_3_0"
]
}
]
}
},
"tests": [
{
@ -199,17 +195,16 @@
{
"description": "extensible: true allows extra items with prefixItems",
"database": {
"schemas": [
{
"schemas": {
"prefixItems_4_0": {
"prefixItems": [
{
"type": "integer"
}
],
"extensible": true,
"$id": "prefixItems_4_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -2,12 +2,11 @@
{
"description": "integer type matches integers",
"database": {
"schemas": [
{
"type": "integer",
"$id": "type_0_0"
"schemas": {
"type_0_0": {
"type": "integer"
}
]
}
},
"tests": [
{
@ -96,12 +95,11 @@
{
"description": "number type matches numbers",
"database": {
"schemas": [
{
"type": "number",
"$id": "type_1_0"
"schemas": {
"type_1_0": {
"type": "number"
}
]
}
},
"tests": [
{
@ -190,12 +188,11 @@
{
"description": "string type matches strings",
"database": {
"schemas": [
{
"type": "string",
"$id": "type_2_0"
"schemas": {
"type_2_0": {
"type": "string"
}
]
}
},
"tests": [
{
@ -284,12 +281,11 @@
{
"description": "object type matches objects",
"database": {
"schemas": [
{
"type": "object",
"$id": "type_3_0"
"schemas": {
"type_3_0": {
"type": "object"
}
]
}
},
"tests": [
{
@ -360,12 +356,11 @@
{
"description": "array type matches arrays",
"database": {
"schemas": [
{
"type": "array",
"$id": "type_4_0"
"schemas": {
"type_4_0": {
"type": "array"
}
]
}
},
"tests": [
{
@ -436,12 +431,11 @@
{
"description": "boolean type matches booleans",
"database": {
"schemas": [
{
"type": "boolean",
"$id": "type_5_0"
"schemas": {
"type_5_0": {
"type": "boolean"
}
]
}
},
"tests": [
{
@ -539,12 +533,11 @@
{
"description": "null type matches only the null object",
"database": {
"schemas": [
{
"type": "null",
"$id": "type_6_0"
"schemas": {
"type_6_0": {
"type": "null"
}
]
}
},
"tests": [
{
@ -642,15 +635,14 @@
{
"description": "multiple types can be specified in an array",
"database": {
"schemas": [
{
"schemas": {
"type_7_0": {
"type": [
"integer",
"string"
],
"$id": "type_7_0"
]
}
]
}
},
"tests": [
{
@ -721,14 +713,13 @@
{
"description": "type as array with one item",
"database": {
"schemas": [
{
"schemas": {
"type_8_0": {
"type": [
"string"
],
"$id": "type_8_0"
]
}
]
}
},
"tests": [
{
@ -754,16 +745,15 @@
{
"description": "type: array or object",
"database": {
"schemas": [
{
"schemas": {
"type_9_0": {
"type": [
"array",
"object"
],
"items": {},
"$id": "type_9_0"
"items": {}
}
]
}
},
"tests": [
{
@ -820,17 +810,16 @@
{
"description": "type: array, object or null",
"database": {
"schemas": [
{
"schemas": {
"type_10_0": {
"type": [
"array",
"object",
"null"
],
"items": {},
"$id": "type_10_0"
"items": {}
}
]
}
},
"tests": [
{
@ -887,13 +876,12 @@
{
"description": "extensible: true allows extra properties",
"database": {
"schemas": [
{
"schemas": {
"type_11_0": {
"type": "object",
"extensible": true,
"$id": "type_11_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -2,8 +2,8 @@
{
"description": "object properties validation",
"database": {
"schemas": [
{
"schemas": {
"properties_0_0": {
"properties": {
"foo": {
"type": "integer"
@ -11,10 +11,9 @@
"bar": {
"type": "string"
}
},
"$id": "properties_0_0"
}
}
]
}
},
"tests": [
{
@ -85,15 +84,14 @@
{
"description": "properties with boolean schema",
"database": {
"schemas": [
{
"schemas": {
"properties_1_0": {
"properties": {
"foo": true,
"bar": false
},
"$id": "properties_1_0"
}
}
]
}
},
"tests": [
{
@ -144,8 +142,8 @@
{
"description": "properties with escaped characters",
"database": {
"schemas": [
{
"schemas": {
"properties_2_0": {
"properties": {
"foo\nbar": {
"type": "number"
@ -165,10 +163,9 @@
"foo\fbar": {
"type": "number"
}
},
"$id": "properties_2_0"
}
}
]
}
},
"tests": [
{
@ -208,16 +205,15 @@
{
"description": "properties with null valued instance properties",
"database": {
"schemas": [
{
"schemas": {
"properties_3_0": {
"properties": {
"foo": {
"type": "null"
}
},
"$id": "properties_3_0"
}
}
]
}
},
"tests": [
{
@ -237,8 +233,8 @@
"description": "properties whose names are Javascript object property names",
"comment": "Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object.",
"database": {
"schemas": [
{
"schemas": {
"properties_4_0": {
"properties": {
"__proto__": {
"type": "number"
@ -253,10 +249,9 @@
"constructor": {
"type": "number"
}
},
"$id": "properties_4_0"
}
}
]
}
},
"tests": [
{
@ -343,17 +338,16 @@
{
"description": "extensible: true allows extra properties",
"database": {
"schemas": [
{
"schemas": {
"properties_5_0": {
"properties": {
"foo": {
"type": "integer"
}
},
"extensible": true,
"$id": "properties_5_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -373,16 +367,15 @@
{
"description": "strict by default: extra properties invalid",
"database": {
"schemas": [
{
"schemas": {
"properties_6_0": {
"properties": {
"foo": {
"type": "string"
}
},
"$id": "properties_6_0"
}
}
]
}
},
"tests": [
{
@ -402,8 +395,8 @@
{
"description": "inheritance: nested object inherits strictness from strict parent",
"database": {
"schemas": [
{
"schemas": {
"properties_7_0": {
"properties": {
"nested": {
"properties": {
@ -412,10 +405,9 @@
}
}
}
},
"$id": "properties_7_0"
}
}
]
}
},
"tests": [
{
@ -437,8 +429,8 @@
{
"description": "override: nested object allows extra properties if extensible: true",
"database": {
"schemas": [
{
"schemas": {
"properties_8_0": {
"properties": {
"nested": {
"extensible": true,
@ -448,10 +440,9 @@
}
}
}
},
"$id": "properties_8_0"
}
}
]
}
},
"tests": [
{
@ -473,8 +464,8 @@
{
"description": "inheritance: nested object inherits looseness from loose parent",
"database": {
"schemas": [
{
"schemas": {
"properties_9_0": {
"extensible": true,
"properties": {
"nested": {
@ -484,10 +475,9 @@
}
}
}
},
"$id": "properties_9_0"
}
}
]
}
},
"tests": [
{
@ -509,8 +499,8 @@
{
"description": "override: nested object enforces strictness if extensible: false",
"database": {
"schemas": [
{
"schemas": {
"properties_10_0": {
"extensible": true,
"properties": {
"nested": {
@ -521,10 +511,9 @@
}
}
}
},
"$id": "properties_10_0"
}
}
]
}
},
"tests": [
{
@ -546,8 +535,8 @@
{
"description": "arrays: inline items inherit strictness from strict parent",
"database": {
"schemas": [
{
"schemas": {
"properties_11_0": {
"properties": {
"list": {
"type": "array",
@ -559,10 +548,9 @@
}
}
}
},
"$id": "properties_11_0"
}
}
]
}
},
"tests": [
{
@ -586,8 +574,8 @@
{
"description": "arrays: inline items inherit looseness from loose parent",
"database": {
"schemas": [
{
"schemas": {
"properties_12_0": {
"extensible": true,
"properties": {
"list": {
@ -600,10 +588,9 @@
}
}
}
},
"$id": "properties_12_0"
}
}
]
}
},
"tests": [
{

View File

@ -2,15 +2,14 @@
{
"description": "propertyNames validation",
"database": {
"schemas": [
{
"schemas": {
"propertyNames_0_0": {
"propertyNames": {
"maxLength": 3
},
"extensible": true,
"$id": "propertyNames_0_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -83,15 +82,14 @@
{
"description": "propertyNames validation with pattern",
"database": {
"schemas": [
{
"schemas": {
"propertyNames_1_0": {
"propertyNames": {
"pattern": "^a+$"
},
"extensible": true,
"$id": "propertyNames_1_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -132,13 +130,12 @@
{
"description": "propertyNames with boolean schema true",
"database": {
"schemas": [
{
"schemas": {
"propertyNames_2_0": {
"propertyNames": true,
"extensible": true,
"$id": "propertyNames_2_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -166,13 +163,12 @@
{
"description": "propertyNames with boolean schema false",
"database": {
"schemas": [
{
"schemas": {
"propertyNames_3_0": {
"propertyNames": false,
"extensible": true,
"$id": "propertyNames_3_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -200,15 +196,14 @@
{
"description": "propertyNames with const",
"database": {
"schemas": [
{
"schemas": {
"propertyNames_4_0": {
"propertyNames": {
"const": "foo"
},
"extensible": true,
"$id": "propertyNames_4_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -247,18 +242,17 @@
{
"description": "propertyNames with enum",
"database": {
"schemas": [
{
"schemas": {
"propertyNames_5_0": {
"propertyNames": {
"enum": [
"foo",
"bar"
]
},
"extensible": true,
"$id": "propertyNames_5_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -309,15 +303,14 @@
{
"description": "extensible: true allows extra properties (checked by propertyNames)",
"database": {
"schemas": [
{
"schemas": {
"propertyNames_6_0": {
"propertyNames": {
"maxLength": 3
},
"extensible": true,
"$id": "propertyNames_6_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -5,66 +5,60 @@
"puncs": [
{
"name": "get_organization",
"schemas": [
{
"$id": "get_organization.response",
"schemas": {
"get_organization.response": {
"type": "organization"
}
]
}
},
{
"name": "get_organizations",
"schemas": [
{
"$id": "get_organizations.response",
"schemas": {
"get_organizations.response": {
"type": "array",
"items": {
"$family": "organization"
}
}
]
}
},
{
"name": "get_light_organization",
"schemas": [
{
"$id": "get_light_organization.response",
"schemas": {
"get_light_organization.response": {
"$family": "light.organization"
}
]
}
},
{
"name": "get_full_organization",
"schemas": [
{
"$id": "get_full_organization.response",
"schemas": {
"get_full_organization.response": {
"$family": "full.organization"
}
]
}
},
{
"name": "get_orders",
"schemas": [
{
"$id": "get_orders.response",
"schemas": {
"get_orders.response": {
"type": "array",
"items": {
"type": "light.order"
}
}
]
}
},
{
"name": "get_widgets",
"schemas": [
{
"$id": "get_widgets.response",
"schemas": {
"get_widgets.response": {
"type": "array",
"items": {
"$family": "widget"
}
}
]
}
}
],
"enums": [],
@ -165,9 +159,8 @@
"created_at": "timestamptz",
"type": "text"
},
"schemas": [
{
"$id": "entity",
"schemas": {
"entity": {
"type": "object",
"properties": {
"id": {
@ -189,7 +182,7 @@
}
}
}
],
},
"fields": [
"id",
"type",
@ -256,9 +249,8 @@
"organization",
"person"
],
"schemas": [
{
"$id": "organization",
"schemas": {
"organization": {
"type": "entity",
"properties": {
"name": {
@ -266,7 +258,7 @@
}
}
}
]
}
},
{
"name": "bot",
@ -309,9 +301,8 @@
"role": "text",
"created_at": "timestamptz"
},
"schemas": [
{
"$id": "bot",
"schemas": {
"bot": {
"type": "organization",
"properties": {
"token": {
@ -322,8 +313,7 @@
}
}
},
{
"$id": "light.bot",
"light.bot": {
"type": "organization",
"properties": {
"token": {
@ -331,7 +321,7 @@
}
}
}
],
},
"variations": [
"bot"
]
@ -379,9 +369,8 @@
"age": "numeric",
"created_at": "timestamptz"
},
"schemas": [
{
"$id": "person",
"schemas": {
"person": {
"type": "organization",
"properties": {
"first_name": {
@ -395,8 +384,7 @@
}
}
},
{
"$id": "light.person",
"light.person": {
"type": "organization",
"properties": {
"first_name": {
@ -407,8 +395,7 @@
}
}
},
{
"$id": "full.person",
"full.person": {
"type": "person",
"properties": {
"phone_numbers": {
@ -467,7 +454,7 @@
}
}
}
],
},
"variations": [
"person"
]
@ -513,13 +500,12 @@
"target_type": "text",
"created_at": "timestamptz"
},
"schemas": [
{
"$id": "relationship",
"schemas": {
"relationship": {
"type": "entity",
"properties": {}
}
],
},
"variations": [
"contact",
"relationship"
@ -572,9 +558,8 @@
"is_primary": "boolean",
"created_at": "timestamptz"
},
"schemas": [
{
"$id": "contact",
"schemas": {
"contact": {
"type": "relationship",
"properties": {
"is_primary": {
@ -582,7 +567,7 @@
}
}
}
],
},
"variations": [
"contact"
]
@ -618,9 +603,8 @@
"number": "text",
"created_at": "timestamptz"
},
"schemas": [
{
"$id": "phone_number",
"schemas": {
"phone_number": {
"type": "entity",
"properties": {
"number": {
@ -628,7 +612,7 @@
}
}
}
],
},
"variations": [
"phone_number"
]
@ -664,9 +648,8 @@
"address": "text",
"created_at": "timestamptz"
},
"schemas": [
{
"$id": "email_address",
"schemas": {
"email_address": {
"type": "entity",
"properties": {
"address": {
@ -674,7 +657,7 @@
}
}
}
],
},
"variations": [
"email_address"
]
@ -710,9 +693,8 @@
"city": "text",
"created_at": "timestamptz"
},
"schemas": [
{
"$id": "address",
"schemas": {
"address": {
"type": "entity",
"properties": {
"city": {
@ -720,16 +702,15 @@
}
}
}
],
},
"variations": [
"address"
]
},
{
"name": "order",
"schemas": [
{
"$id": "order",
"schemas": {
"order": {
"type": "entity",
"properties": {
"total": {
@ -740,8 +721,7 @@
}
}
},
{
"$id": "light.order",
"light.order": {
"type": "order",
"properties": {
"customer": {
@ -749,8 +729,7 @@
}
}
},
{
"$id": "full.order",
"full.order": {
"type": "order",
"properties": {
"customer": {
@ -764,7 +743,7 @@
}
}
}
],
},
"hierarchy": [
"order",
"entity"
@ -825,9 +804,8 @@
},
{
"name": "order_line",
"schemas": [
{
"$id": "order_line",
"schemas": {
"order_line": {
"type": "entity",
"properties": {
"order_id": {
@ -841,7 +819,7 @@
}
}
}
],
},
"hierarchy": [
"order_line",
"entity"
@ -929,9 +907,8 @@
"variations": [
"widget"
],
"schemas": [
{
"$id": "widget",
"schemas": {
"widget": {
"type": "entity",
"properties": {
"kind": {
@ -939,25 +916,15 @@
}
}
},
{
"$id": "stock.widget",
"stock.widget": {
"type": "widget",
"properties": {
"kind": {
"const": "stock"
}
}
"properties": {}
},
{
"$id": "tasks.widget",
"tasks.widget": {
"type": "widget",
"properties": {
"kind": {
"const": "tasks"
}
}
"properties": {}
}
]
}
}
]
},
@ -1506,7 +1473,7 @@
"success": true,
"sql": [
[
"(SELECT jsonb_strip_nulls((SELECT jsonb_build_object(",
"(SELECT jsonb_strip_nulls((SELECT COALESCE(jsonb_agg(jsonb_build_object(",
" 'archived', entity_3.archived,",
" 'created_at', entity_3.created_at,",
" 'id', entity_3.id,",
@ -1525,7 +1492,7 @@
" NOT entity_5.archived",
" AND relationship_2.target_id = entity_5.id),",
" 'type', entity_3.type",
")",
")), '[]'::jsonb)",
"FROM agreego.contact contact_1",
"JOIN agreego.relationship relationship_2 ON relationship_2.id = contact_1.id",
"JOIN agreego.entity entity_3 ON entity_3.id = relationship_2.id",

View File

@ -2,18 +2,17 @@
{
"description": "required validation",
"database": {
"schemas": [
{
"schemas": {
"required_0_0": {
"properties": {
"foo": {},
"bar": {}
},
"required": [
"foo"
],
"$id": "required_0_0"
]
}
]
}
},
"tests": [
{
@ -88,14 +87,13 @@
{
"description": "required default validation",
"database": {
"schemas": [
{
"schemas": {
"required_1_0": {
"properties": {
"foo": {}
},
"$id": "required_1_0"
}
}
]
}
},
"tests": [
{
@ -112,15 +110,14 @@
{
"description": "required with empty array",
"database": {
"schemas": [
{
"schemas": {
"required_2_0": {
"properties": {
"foo": {}
},
"required": [],
"$id": "required_2_0"
"required": []
}
]
}
},
"tests": [
{
@ -137,8 +134,8 @@
{
"description": "required with escaped characters",
"database": {
"schemas": [
{
"schemas": {
"required_3_0": {
"required": [
"foo\nbar",
"foo\"bar",
@ -147,10 +144,9 @@
"foo\tbar",
"foo\fbar"
],
"extensible": true,
"$id": "required_3_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -187,17 +183,16 @@
"description": "required properties whose names are Javascript object property names",
"comment": "Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object.",
"database": {
"schemas": [
{
"schemas": {
"required_4_0": {
"required": [
"__proto__",
"toString",
"constructor"
],
"extensible": true,
"$id": "required_4_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -284,15 +279,14 @@
{
"description": "extensible: true allows extra properties in required",
"database": {
"schemas": [
{
"schemas": {
"required_5_0": {
"required": [
"foo"
],
"extensible": true,
"$id": "required_5_0"
"extensible": true
}
]
}
},
"tests": [
{

View File

@ -2,13 +2,12 @@
{
"description": "uniqueItems validation",
"database": {
"schemas": [
{
"schemas": {
"uniqueItems_0_0": {
"uniqueItems": true,
"extensible": true,
"$id": "uniqueItems_0_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -469,8 +468,8 @@
{
"description": "uniqueItems with an array of items",
"database": {
"schemas": [
{
"schemas": {
"uniqueItems_1_0": {
"prefixItems": [
{
"type": "boolean"
@ -480,10 +479,9 @@
}
],
"uniqueItems": true,
"extensible": true,
"$id": "uniqueItems_1_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -595,8 +593,8 @@
{
"description": "uniqueItems with an array of items and additionalItems=false",
"database": {
"schemas": [
{
"schemas": {
"uniqueItems_2_0": {
"prefixItems": [
{
"type": "boolean"
@ -606,10 +604,9 @@
}
],
"uniqueItems": true,
"items": false,
"$id": "uniqueItems_2_0"
"items": false
}
]
}
},
"tests": [
{
@ -678,13 +675,12 @@
{
"description": "uniqueItems=false validation",
"database": {
"schemas": [
{
"schemas": {
"uniqueItems_3_0": {
"uniqueItems": false,
"extensible": true,
"$id": "uniqueItems_3_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -924,8 +920,8 @@
{
"description": "uniqueItems=false with an array of items",
"database": {
"schemas": [
{
"schemas": {
"uniqueItems_4_0": {
"prefixItems": [
{
"type": "boolean"
@ -935,10 +931,9 @@
}
],
"uniqueItems": false,
"extensible": true,
"$id": "uniqueItems_4_0"
"extensible": true
}
]
}
},
"tests": [
{
@ -1050,8 +1045,8 @@
{
"description": "uniqueItems=false with an array of items and additionalItems=false",
"database": {
"schemas": [
{
"schemas": {
"uniqueItems_5_0": {
"prefixItems": [
{
"type": "boolean"
@ -1061,10 +1056,9 @@
}
],
"uniqueItems": false,
"items": false,
"$id": "uniqueItems_5_0"
"items": false
}
]
}
},
"tests": [
{
@ -1133,13 +1127,12 @@
{
"description": "extensible: true allows extra items in uniqueItems",
"database": {
"schemas": [
{
"schemas": {
"uniqueItems_6_0": {
"uniqueItems": true,
"extensible": true,
"$id": "uniqueItems_6_0"
"extensible": true
}
]
}
},
"tests": [
{