Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3928174fe7 | |||
| f450f8ab8b | |||
| 8ebf6a69bf | |||
| 3a4c53dc7d | |||
| 69bd726b25 |
@ -2,21 +2,26 @@
|
|||||||
{
|
{
|
||||||
"description": "additionalProperties validates properties not matched by properties",
|
"description": "additionalProperties validates properties not matched by properties",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema1": {
|
{
|
||||||
"properties": {
|
"name": "schema1",
|
||||||
"foo": {
|
"schemas": {
|
||||||
"type": "string"
|
"schema1": {
|
||||||
},
|
"properties": {
|
||||||
"bar": {
|
"foo": {
|
||||||
"type": "number"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"bar": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -61,19 +66,24 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true with additionalProperties still validates structure",
|
"description": "extensible: true with additionalProperties still validates structure",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"additionalProperties_1_0": {
|
{
|
||||||
"properties": {
|
"name": "additionalProperties_1_0",
|
||||||
"foo": {
|
"schemas": {
|
||||||
"type": "string"
|
"additionalProperties_1_0": {
|
||||||
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extensible": true,
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"extensible": true,
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "integer"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -106,21 +116,26 @@
|
|||||||
{
|
{
|
||||||
"description": "complex additionalProperties with object and array items",
|
"description": "complex additionalProperties with object and array items",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema3": {
|
{
|
||||||
"properties": {
|
"name": "schema3",
|
||||||
"type": {
|
"schemas": {
|
||||||
"type": "string"
|
"schema3": {
|
||||||
}
|
"properties": {
|
||||||
},
|
"type": {
|
||||||
"additionalProperties": {
|
"type": "string"
|
||||||
"type": "array",
|
}
|
||||||
"items": {
|
},
|
||||||
"type": "string"
|
"additionalProperties": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,9 +2,14 @@
|
|||||||
{
|
{
|
||||||
"description": "boolean schema 'true'",
|
"description": "boolean schema 'true'",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"booleanSchema_0_0": {}
|
{
|
||||||
}
|
"name": "booleanSchema_0_0",
|
||||||
|
"schemas": {
|
||||||
|
"booleanSchema_0_0": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -97,11 +102,16 @@
|
|||||||
{
|
{
|
||||||
"description": "boolean schema 'false'",
|
"description": "boolean schema 'false'",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"booleanSchema_1_0": {
|
{
|
||||||
"not": {}
|
"name": "booleanSchema_1_0",
|
||||||
|
"schemas": {
|
||||||
|
"booleanSchema_1_0": {
|
||||||
|
"not": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,218 +2,238 @@
|
|||||||
{
|
{
|
||||||
"description": "Multi-Paradigm Declarative Cases",
|
"description": "Multi-Paradigm Declarative Cases",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"parallel_rules": {
|
{
|
||||||
"type": "object",
|
"name": "parallel_rules",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"status": {
|
"parallel_rules": {
|
||||||
"type": "string"
|
"type": "object",
|
||||||
},
|
"properties": {
|
||||||
"kind": {
|
"status": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
|
||||||
},
|
|
||||||
"cases": [
|
|
||||||
{
|
|
||||||
"when": {
|
|
||||||
"properties": {
|
|
||||||
"status": {
|
|
||||||
"const": "unverified"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"required": [
|
"kind": {
|
||||||
"status"
|
"type": "string"
|
||||||
]
|
}
|
||||||
},
|
},
|
||||||
"then": {
|
"cases": [
|
||||||
"properties": {
|
{
|
||||||
"amount_1": {
|
"when": {
|
||||||
"type": "number"
|
"properties": {
|
||||||
|
"status": {
|
||||||
|
"const": "unverified"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"status"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"amount_2": {
|
"then": {
|
||||||
"type": "number"
|
"properties": {
|
||||||
}
|
"amount_1": {
|
||||||
},
|
"type": "number"
|
||||||
"required": [
|
|
||||||
"amount_1",
|
|
||||||
"amount_2"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"when": {
|
|
||||||
"properties": {
|
|
||||||
"kind": {
|
|
||||||
"const": "credit"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"kind"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"then": {
|
|
||||||
"properties": {
|
|
||||||
"cvv": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"cvv"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"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"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"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": [
|
"amount_2": {
|
||||||
"tier"
|
"type": "number"
|
||||||
]
|
}
|
||||||
},
|
},
|
||||||
"then": {
|
"required": [
|
||||||
"properties": {
|
"amount_1",
|
||||||
"standard": {
|
"amount_2"
|
||||||
"type": "number"
|
]
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"standard"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"else": {
|
|
||||||
"properties": {
|
|
||||||
"premium": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"premium"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"missing_when": {
|
|
||||||
"type": "object",
|
|
||||||
"cases": [
|
|
||||||
{
|
|
||||||
"else": {
|
|
||||||
"properties": {
|
|
||||||
"unconditional": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
{
|
||||||
"unconditional"
|
"when": {
|
||||||
]
|
"properties": {
|
||||||
}
|
"kind": {
|
||||||
|
"const": "credit"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"kind"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"then": {
|
||||||
|
"properties": {
|
||||||
|
"cvv": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"cvv"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mutually_exclusive",
|
||||||
|
"schemas": {
|
||||||
|
"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"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"else": {
|
||||||
|
"properties": {
|
||||||
|
"fallback_b": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"fallback_b"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "nested_fallbacks",
|
||||||
|
"schemas": {
|
||||||
|
"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"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"else": {
|
||||||
|
"properties": {
|
||||||
|
"premium": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"premium"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "missing_when",
|
||||||
|
"schemas": {
|
||||||
|
"missing_when": {
|
||||||
|
"type": "object",
|
||||||
|
"cases": [
|
||||||
|
{
|
||||||
|
"else": {
|
||||||
|
"properties": {
|
||||||
|
"unconditional": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"unconditional"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,16 @@
|
|||||||
{
|
{
|
||||||
"description": "const validation",
|
"description": "const validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_0_0": {
|
{
|
||||||
"const": 2
|
"name": "const_0_0",
|
||||||
|
"schemas": {
|
||||||
|
"const_0_0": {
|
||||||
|
"const": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -41,18 +46,23 @@
|
|||||||
{
|
{
|
||||||
"description": "const with object",
|
"description": "const with object",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_1_0": {
|
{
|
||||||
"const": {
|
"name": "const_1_0",
|
||||||
"foo": "bar",
|
"schemas": {
|
||||||
"baz": "bax"
|
"const_1_0": {
|
||||||
},
|
"const": {
|
||||||
"properties": {
|
"foo": "bar",
|
||||||
"foo": {},
|
"baz": "bax"
|
||||||
"baz": {}
|
},
|
||||||
|
"properties": {
|
||||||
|
"foo": {},
|
||||||
|
"baz": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -107,15 +117,20 @@
|
|||||||
{
|
{
|
||||||
"description": "const with array",
|
"description": "const with array",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_2_0": {
|
{
|
||||||
"const": [
|
"name": "const_2_0",
|
||||||
{
|
"schemas": {
|
||||||
"foo": "bar"
|
"const_2_0": {
|
||||||
|
"const": [
|
||||||
|
{
|
||||||
|
"foo": "bar"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -160,11 +175,16 @@
|
|||||||
{
|
{
|
||||||
"description": "const with null",
|
"description": "const with null",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_3_0": {
|
{
|
||||||
"const": null
|
"name": "const_3_0",
|
||||||
|
"schemas": {
|
||||||
|
"const_3_0": {
|
||||||
|
"const": null
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -190,11 +210,16 @@
|
|||||||
{
|
{
|
||||||
"description": "const with false does not match 0",
|
"description": "const with false does not match 0",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_4_0": {
|
{
|
||||||
"const": false
|
"name": "const_4_0",
|
||||||
|
"schemas": {
|
||||||
|
"const_4_0": {
|
||||||
|
"const": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -229,11 +254,16 @@
|
|||||||
{
|
{
|
||||||
"description": "const with true does not match 1",
|
"description": "const with true does not match 1",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_5_0": {
|
{
|
||||||
"const": true
|
"name": "const_5_0",
|
||||||
|
"schemas": {
|
||||||
|
"const_5_0": {
|
||||||
|
"const": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -268,13 +298,18 @@
|
|||||||
{
|
{
|
||||||
"description": "const with [false] does not match [0]",
|
"description": "const with [false] does not match [0]",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_6_0": {
|
{
|
||||||
"const": [
|
"name": "const_6_0",
|
||||||
false
|
"schemas": {
|
||||||
]
|
"const_6_0": {
|
||||||
|
"const": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -315,13 +350,18 @@
|
|||||||
{
|
{
|
||||||
"description": "const with [true] does not match [1]",
|
"description": "const with [true] does not match [1]",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_7_0": {
|
{
|
||||||
"const": [
|
"name": "const_7_0",
|
||||||
true
|
"schemas": {
|
||||||
]
|
"const_7_0": {
|
||||||
|
"const": [
|
||||||
|
true
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -362,13 +402,18 @@
|
|||||||
{
|
{
|
||||||
"description": "const with {\"a\": false} does not match {\"a\": 0}",
|
"description": "const with {\"a\": false} does not match {\"a\": 0}",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_8_0": {
|
{
|
||||||
"const": {
|
"name": "const_8_0",
|
||||||
"a": false
|
"schemas": {
|
||||||
|
"const_8_0": {
|
||||||
|
"const": {
|
||||||
|
"a": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -409,13 +454,18 @@
|
|||||||
{
|
{
|
||||||
"description": "const with {\"a\": true} does not match {\"a\": 1}",
|
"description": "const with {\"a\": true} does not match {\"a\": 1}",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_9_0": {
|
{
|
||||||
"const": {
|
"name": "const_9_0",
|
||||||
"a": true
|
"schemas": {
|
||||||
|
"const_9_0": {
|
||||||
|
"const": {
|
||||||
|
"a": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -456,11 +506,16 @@
|
|||||||
{
|
{
|
||||||
"description": "const with 0 does not match other zero-like types",
|
"description": "const with 0 does not match other zero-like types",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_10_0": {
|
{
|
||||||
"const": 0
|
"name": "const_10_0",
|
||||||
|
"schemas": {
|
||||||
|
"const_10_0": {
|
||||||
|
"const": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -522,11 +577,16 @@
|
|||||||
{
|
{
|
||||||
"description": "const with 1 does not match true",
|
"description": "const with 1 does not match true",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_11_0": {
|
{
|
||||||
"const": 1
|
"name": "const_11_0",
|
||||||
|
"schemas": {
|
||||||
|
"const_11_0": {
|
||||||
|
"const": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -561,11 +621,16 @@
|
|||||||
{
|
{
|
||||||
"description": "const with -2.0 matches integer and float types",
|
"description": "const with -2.0 matches integer and float types",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_12_0": {
|
{
|
||||||
"const": -2
|
"name": "const_12_0",
|
||||||
|
"schemas": {
|
||||||
|
"const_12_0": {
|
||||||
|
"const": -2
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -618,11 +683,16 @@
|
|||||||
{
|
{
|
||||||
"description": "float and integers are equal up to 64-bit representation limits",
|
"description": "float and integers are equal up to 64-bit representation limits",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_13_0": {
|
{
|
||||||
"const": 9007199254740992
|
"name": "const_13_0",
|
||||||
|
"schemas": {
|
||||||
|
"const_13_0": {
|
||||||
|
"const": 9007199254740992
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -666,11 +736,16 @@
|
|||||||
{
|
{
|
||||||
"description": "nul characters in strings",
|
"description": "nul characters in strings",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_14_0": {
|
{
|
||||||
"const": "hello\u0000there"
|
"name": "const_14_0",
|
||||||
|
"schemas": {
|
||||||
|
"const_14_0": {
|
||||||
|
"const": "hello\u0000there"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -696,17 +771,22 @@
|
|||||||
{
|
{
|
||||||
"description": "characters with the same visual representation but different codepoint",
|
"description": "characters with the same visual representation but different codepoint",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_15_0": {
|
{
|
||||||
"const": "μ",
|
"name": "const_15_0",
|
||||||
"$comment": "U+03BC"
|
"schemas": {
|
||||||
|
"const_15_0": {
|
||||||
|
"const": "\u03bc",
|
||||||
|
"$comment": "U+03BC"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
"description": "character uses the same codepoint",
|
"description": "character uses the same codepoint",
|
||||||
"data": "μ",
|
"data": "\u03bc",
|
||||||
"comment": "U+03BC",
|
"comment": "U+03BC",
|
||||||
"schema_id": "const_15_0",
|
"schema_id": "const_15_0",
|
||||||
"action": "validate",
|
"action": "validate",
|
||||||
@ -716,7 +796,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "character looks the same but uses a different codepoint",
|
"description": "character looks the same but uses a different codepoint",
|
||||||
"data": "µ",
|
"data": "\u00b5",
|
||||||
"comment": "U+00B5",
|
"comment": "U+00B5",
|
||||||
"schema_id": "const_15_0",
|
"schema_id": "const_15_0",
|
||||||
"action": "validate",
|
"action": "validate",
|
||||||
@ -729,17 +809,22 @@
|
|||||||
{
|
{
|
||||||
"description": "characters with the same visual representation, but different number of codepoints",
|
"description": "characters with the same visual representation, but different number of codepoints",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_16_0": {
|
{
|
||||||
"const": "ä",
|
"name": "const_16_0",
|
||||||
"$comment": "U+00E4"
|
"schemas": {
|
||||||
|
"const_16_0": {
|
||||||
|
"const": "\u00e4",
|
||||||
|
"$comment": "U+00E4"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
"description": "character uses the same codepoint",
|
"description": "character uses the same codepoint",
|
||||||
"data": "ä",
|
"data": "\u00e4",
|
||||||
"comment": "U+00E4",
|
"comment": "U+00E4",
|
||||||
"schema_id": "const_16_0",
|
"schema_id": "const_16_0",
|
||||||
"action": "validate",
|
"action": "validate",
|
||||||
@ -749,7 +834,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "character looks the same but uses combining marks",
|
"description": "character looks the same but uses combining marks",
|
||||||
"data": "ä",
|
"data": "a\u0308",
|
||||||
"comment": "a, U+0308",
|
"comment": "a, U+0308",
|
||||||
"schema_id": "const_16_0",
|
"schema_id": "const_16_0",
|
||||||
"action": "validate",
|
"action": "validate",
|
||||||
@ -762,14 +847,19 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra properties in const object match",
|
"description": "extensible: true allows extra properties in const object match",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"const_17_0": {
|
{
|
||||||
"const": {
|
"name": "const_17_0",
|
||||||
"a": 1
|
"schemas": {
|
||||||
},
|
"const_17_0": {
|
||||||
"extensible": true
|
"const": {
|
||||||
|
"a": 1
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,14 +2,19 @@
|
|||||||
{
|
{
|
||||||
"description": "contains keyword validation",
|
"description": "contains keyword validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"contains_0_0": {
|
{
|
||||||
"contains": {
|
"name": "contains_0_0",
|
||||||
"minimum": 5
|
"schemas": {
|
||||||
},
|
"contains_0_0": {
|
||||||
"items": true
|
"contains": {
|
||||||
|
"minimum": 5
|
||||||
|
},
|
||||||
|
"items": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -88,14 +93,19 @@
|
|||||||
{
|
{
|
||||||
"description": "contains keyword with const keyword",
|
"description": "contains keyword with const keyword",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"contains_1_0": {
|
{
|
||||||
"contains": {
|
"name": "contains_1_0",
|
||||||
"const": 5
|
"schemas": {
|
||||||
},
|
"contains_1_0": {
|
||||||
"items": true
|
"contains": {
|
||||||
|
"const": 5
|
||||||
|
},
|
||||||
|
"items": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -144,11 +154,16 @@
|
|||||||
{
|
{
|
||||||
"description": "contains keyword with boolean schema true",
|
"description": "contains keyword with boolean schema true",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"contains_2_0": {
|
{
|
||||||
"contains": true
|
"name": "contains_2_0",
|
||||||
|
"schemas": {
|
||||||
|
"contains_2_0": {
|
||||||
|
"contains": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -176,11 +191,16 @@
|
|||||||
{
|
{
|
||||||
"description": "contains keyword with boolean schema false",
|
"description": "contains keyword with boolean schema false",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"contains_3_0": {
|
{
|
||||||
"contains": false
|
"name": "contains_3_0",
|
||||||
|
"schemas": {
|
||||||
|
"contains_3_0": {
|
||||||
|
"contains": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -217,16 +237,21 @@
|
|||||||
{
|
{
|
||||||
"description": "items + contains",
|
"description": "items + contains",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"contains_4_0": {
|
{
|
||||||
"items": {
|
"name": "contains_4_0",
|
||||||
"multipleOf": 2
|
"schemas": {
|
||||||
},
|
"contains_4_0": {
|
||||||
"contains": {
|
"items": {
|
||||||
"multipleOf": 3
|
"multipleOf": 2
|
||||||
|
},
|
||||||
|
"contains": {
|
||||||
|
"multipleOf": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -284,14 +309,19 @@
|
|||||||
{
|
{
|
||||||
"description": "contains with false if subschema",
|
"description": "contains with false if subschema",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"contains_5_0": {
|
{
|
||||||
"contains": {
|
"name": "contains_5_0",
|
||||||
"if": false,
|
"schemas": {
|
||||||
"else": true
|
"contains_5_0": {
|
||||||
|
"contains": {
|
||||||
|
"if": false,
|
||||||
|
"else": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -319,13 +349,18 @@
|
|||||||
{
|
{
|
||||||
"description": "contains with null instance elements",
|
"description": "contains with null instance elements",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"contains_6_0": {
|
{
|
||||||
"contains": {
|
"name": "contains_6_0",
|
||||||
"type": "null"
|
"schemas": {
|
||||||
|
"contains_6_0": {
|
||||||
|
"contains": {
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -344,14 +379,19 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows non-matching items in contains",
|
"description": "extensible: true allows non-matching items in contains",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"contains_7_0": {
|
{
|
||||||
"contains": {
|
"name": "contains_7_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"contains_7_0": {
|
||||||
"extensible": true
|
"contains": {
|
||||||
|
"const": 1
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -371,13 +411,18 @@
|
|||||||
{
|
{
|
||||||
"description": "strict by default: non-matching items in contains are invalid",
|
"description": "strict by default: non-matching items in contains are invalid",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"contains_8_0": {
|
{
|
||||||
"contains": {
|
"name": "contains_8_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
|
"contains_8_0": {
|
||||||
|
"contains": {
|
||||||
|
"const": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,16 @@
|
|||||||
{
|
{
|
||||||
"description": "validation of string-encoded content based on media type",
|
"description": "validation of string-encoded content based on media type",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"content_0_0": {
|
{
|
||||||
"contentMediaType": "application/json"
|
"name": "content_0_0",
|
||||||
|
"schemas": {
|
||||||
|
"content_0_0": {
|
||||||
|
"contentMediaType": "application/json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -41,11 +46,16 @@
|
|||||||
{
|
{
|
||||||
"description": "validation of binary string-encoding",
|
"description": "validation of binary string-encoding",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"content_1_0": {
|
{
|
||||||
"contentEncoding": "base64"
|
"name": "content_1_0",
|
||||||
|
"schemas": {
|
||||||
|
"content_1_0": {
|
||||||
|
"contentEncoding": "base64"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -80,12 +90,17 @@
|
|||||||
{
|
{
|
||||||
"description": "validation of binary-encoded media type documents",
|
"description": "validation of binary-encoded media type documents",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"content_2_0": {
|
{
|
||||||
"contentMediaType": "application/json",
|
"name": "content_2_0",
|
||||||
"contentEncoding": "base64"
|
"schemas": {
|
||||||
|
"content_2_0": {
|
||||||
|
"contentMediaType": "application/json",
|
||||||
|
"contentEncoding": "base64"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -129,26 +144,31 @@
|
|||||||
{
|
{
|
||||||
"description": "validation of binary-encoded media type documents with schema",
|
"description": "validation of binary-encoded media type documents with schema",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"content_3_0": {
|
{
|
||||||
"contentMediaType": "application/json",
|
"name": "content_3_0",
|
||||||
"contentEncoding": "base64",
|
"schemas": {
|
||||||
"contentSchema": {
|
"content_3_0": {
|
||||||
"type": "object",
|
"contentMediaType": "application/json",
|
||||||
"required": [
|
"contentEncoding": "base64",
|
||||||
"foo"
|
"contentSchema": {
|
||||||
],
|
"type": "object",
|
||||||
"properties": {
|
"required": [
|
||||||
"foo": {
|
"foo"
|
||||||
"type": "string"
|
],
|
||||||
},
|
"properties": {
|
||||||
"boo": {
|
"foo": {
|
||||||
"type": "integer"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"boo": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,17 +2,22 @@
|
|||||||
{
|
{
|
||||||
"description": "single dependency (required)",
|
"description": "single dependency (required)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema1": {
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"name": "schema1",
|
||||||
"dependencies": {
|
"schemas": {
|
||||||
"bar": [
|
"schema1": {
|
||||||
"foo"
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
]
|
"dependencies": {
|
||||||
},
|
"bar": [
|
||||||
"extensible": true
|
"foo"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -92,15 +97,20 @@
|
|||||||
{
|
{
|
||||||
"description": "empty dependents",
|
"description": "empty dependents",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema2": {
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"name": "schema2",
|
||||||
"dependencies": {
|
"schemas": {
|
||||||
"bar": []
|
"schema2": {
|
||||||
},
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"extensible": true
|
"dependencies": {
|
||||||
|
"bar": []
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -137,18 +147,23 @@
|
|||||||
{
|
{
|
||||||
"description": "multiple dependents required",
|
"description": "multiple dependents required",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema3": {
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"name": "schema3",
|
||||||
"dependencies": {
|
"schemas": {
|
||||||
"quux": [
|
"schema3": {
|
||||||
"foo",
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"bar"
|
"dependencies": {
|
||||||
]
|
"quux": [
|
||||||
},
|
"foo",
|
||||||
"extensible": true
|
"bar"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -225,20 +240,25 @@
|
|||||||
{
|
{
|
||||||
"description": "dependencies with escaped characters",
|
"description": "dependencies with escaped characters",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema4": {
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"name": "schema4",
|
||||||
"dependencies": {
|
"schemas": {
|
||||||
"foo\nbar": [
|
"schema4": {
|
||||||
"foo\rbar"
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
],
|
"dependencies": {
|
||||||
"foo\"bar": [
|
"foo\nbar": [
|
||||||
"foo'bar"
|
"foo\rbar"
|
||||||
]
|
],
|
||||||
},
|
"foo\"bar": [
|
||||||
"extensible": true
|
"foo'bar"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -293,17 +313,22 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra properties in dependentRequired",
|
"description": "extensible: true allows extra properties in dependentRequired",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema5": {
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"name": "schema5",
|
||||||
"dependencies": {
|
"schemas": {
|
||||||
"bar": [
|
"schema5": {
|
||||||
"foo"
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
]
|
"dependencies": {
|
||||||
},
|
"bar": [
|
||||||
"extensible": true
|
"foo"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -324,27 +349,32 @@
|
|||||||
{
|
{
|
||||||
"description": "single dependency (schemas, STRICT)",
|
"description": "single dependency (schemas, STRICT)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema_schema1": {
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"name": "schema_schema1",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"foo": true,
|
"schema_schema1": {
|
||||||
"bar": true
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"bar": {
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"foo": {
|
"foo": true,
|
||||||
"type": "integer"
|
"bar": true
|
||||||
},
|
},
|
||||||
|
"dependencies": {
|
||||||
"bar": {
|
"bar": {
|
||||||
"type": "integer"
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"bar": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -445,28 +475,33 @@
|
|||||||
{
|
{
|
||||||
"description": "single dependency (schemas, EXTENSIBLE)",
|
"description": "single dependency (schemas, EXTENSIBLE)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema_schema2": {
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"name": "schema_schema2",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"foo": true,
|
"schema_schema2": {
|
||||||
"bar": true
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"bar": {
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"foo": {
|
"foo": true,
|
||||||
"type": "integer"
|
"bar": true
|
||||||
},
|
},
|
||||||
|
"dependencies": {
|
||||||
"bar": {
|
"bar": {
|
||||||
"type": "integer"
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"bar": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"extensible": true
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"extensible": true
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -485,19 +520,24 @@
|
|||||||
{
|
{
|
||||||
"description": "boolean subschemas",
|
"description": "boolean subschemas",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema_schema3": {
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"name": "schema_schema3",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"foo": true,
|
"schema_schema3": {
|
||||||
"bar": true
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
},
|
"properties": {
|
||||||
"dependencies": {
|
"foo": true,
|
||||||
"foo": true,
|
"bar": true
|
||||||
"bar": false
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"foo": true,
|
||||||
|
"bar": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -548,29 +588,34 @@
|
|||||||
{
|
{
|
||||||
"description": "dependencies with escaped characters",
|
"description": "dependencies with escaped characters",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema_schema4": {
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"name": "schema_schema4",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"foo\tbar": true,
|
"schema_schema4": {
|
||||||
"foo'bar": true,
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"a": true,
|
"properties": {
|
||||||
"b": true,
|
"foo\tbar": true,
|
||||||
"c": true
|
"foo'bar": true,
|
||||||
},
|
"a": true,
|
||||||
"dependencies": {
|
"b": true,
|
||||||
"foo\tbar": {
|
"c": true
|
||||||
"minProperties": 4,
|
},
|
||||||
"extensible": true
|
"dependencies": {
|
||||||
},
|
"foo\tbar": {
|
||||||
"foo'bar": {
|
"minProperties": 4,
|
||||||
"required": [
|
"extensible": true
|
||||||
"foo\"bar"
|
},
|
||||||
]
|
"foo'bar": {
|
||||||
|
"required": [
|
||||||
|
"foo\"bar"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -628,22 +673,27 @@
|
|||||||
{
|
{
|
||||||
"description": "dependent subschema incompatible with root (STRICT)",
|
"description": "dependent subschema incompatible with root (STRICT)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema_schema5": {
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"name": "schema_schema5",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"foo": {},
|
"schema_schema5": {
|
||||||
"baz": true
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"foo": {
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"bar": {}
|
"foo": {},
|
||||||
|
"baz": true
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"foo": {
|
||||||
|
"properties": {
|
||||||
|
"bar": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -701,24 +751,29 @@
|
|||||||
{
|
{
|
||||||
"description": "dependent subschema incompatible with root (EXTENSIBLE)",
|
"description": "dependent subschema incompatible with root (EXTENSIBLE)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"schema_schema6": {
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"name": "schema_schema6",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"foo": {},
|
"schema_schema6": {
|
||||||
"baz": true
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"foo": {
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"bar": {}
|
"foo": {},
|
||||||
|
"baz": true
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"dependencies": {
|
||||||
|
"foo": {
|
||||||
|
"properties": {
|
||||||
|
"bar": {}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"extensible": true
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,43 +2,48 @@
|
|||||||
{
|
{
|
||||||
"description": "empty string is valid for all types (except const)",
|
"description": "empty string is valid for all types (except const)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"emptyString_0_0": {
|
{
|
||||||
"properties": {
|
"name": "emptyString_0_0",
|
||||||
"obj": {
|
"schemas": {
|
||||||
"type": "object"
|
"emptyString_0_0": {
|
||||||
},
|
"properties": {
|
||||||
"arr": {
|
"obj": {
|
||||||
"type": "array"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"str": {
|
"arr": {
|
||||||
"type": "string"
|
"type": "array"
|
||||||
},
|
},
|
||||||
"int": {
|
"str": {
|
||||||
"type": "integer"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"num": {
|
"int": {
|
||||||
"type": "number"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"bool": {
|
"num": {
|
||||||
"type": "boolean"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"nul": {
|
"bool": {
|
||||||
"type": "null"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"fmt": {
|
"nul": {
|
||||||
"type": "string",
|
"type": "null"
|
||||||
"format": "uuid"
|
},
|
||||||
},
|
"fmt": {
|
||||||
"con": {
|
"type": "string",
|
||||||
"const": "value"
|
"format": "uuid"
|
||||||
},
|
},
|
||||||
"con_empty": {
|
"con": {
|
||||||
"const": ""
|
"const": "value"
|
||||||
|
},
|
||||||
|
"con_empty": {
|
||||||
|
"const": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,15 +2,20 @@
|
|||||||
{
|
{
|
||||||
"description": "simple enum validation",
|
"description": "simple enum validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_0_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_0_0",
|
||||||
1,
|
"schemas": {
|
||||||
2,
|
"enum_0_0": {
|
||||||
3
|
"enum": [
|
||||||
]
|
1,
|
||||||
|
2,
|
||||||
|
3
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -36,22 +41,27 @@
|
|||||||
{
|
{
|
||||||
"description": "heterogeneous enum validation",
|
"description": "heterogeneous enum validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_1_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_1_0",
|
||||||
6,
|
"schemas": {
|
||||||
"foo",
|
"enum_1_0": {
|
||||||
[],
|
"enum": [
|
||||||
true,
|
6,
|
||||||
{
|
"foo",
|
||||||
"foo": 12
|
[],
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"foo": 12
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"foo": {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"foo": {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -111,14 +121,19 @@
|
|||||||
{
|
{
|
||||||
"description": "heterogeneous enum-with-null validation",
|
"description": "heterogeneous enum-with-null validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_2_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_2_0",
|
||||||
6,
|
"schemas": {
|
||||||
null
|
"enum_2_0": {
|
||||||
]
|
"enum": [
|
||||||
|
6,
|
||||||
|
null
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -153,26 +168,31 @@
|
|||||||
{
|
{
|
||||||
"description": "enums in properties",
|
"description": "enums in properties",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_3_0": {
|
{
|
||||||
"type": "object",
|
"name": "enum_3_0",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"foo": {
|
"enum_3_0": {
|
||||||
"enum": [
|
"type": "object",
|
||||||
"foo"
|
"properties": {
|
||||||
]
|
"foo": {
|
||||||
},
|
"enum": [
|
||||||
"bar": {
|
"foo"
|
||||||
"enum": [
|
]
|
||||||
|
},
|
||||||
|
"bar": {
|
||||||
|
"enum": [
|
||||||
|
"bar"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
"bar"
|
"bar"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"required": [
|
|
||||||
"bar"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -247,14 +267,19 @@
|
|||||||
{
|
{
|
||||||
"description": "enum with escaped characters",
|
"description": "enum with escaped characters",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_4_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_4_0",
|
||||||
"foo\nbar",
|
"schemas": {
|
||||||
"foo\rbar"
|
"enum_4_0": {
|
||||||
]
|
"enum": [
|
||||||
|
"foo\nbar",
|
||||||
|
"foo\rbar"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -289,13 +314,18 @@
|
|||||||
{
|
{
|
||||||
"description": "enum with false does not match 0",
|
"description": "enum with false does not match 0",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_5_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_5_0",
|
||||||
false
|
"schemas": {
|
||||||
]
|
"enum_5_0": {
|
||||||
|
"enum": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -330,15 +360,20 @@
|
|||||||
{
|
{
|
||||||
"description": "enum with [false] does not match [0]",
|
"description": "enum with [false] does not match [0]",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_6_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_6_0",
|
||||||
[
|
"schemas": {
|
||||||
false
|
"enum_6_0": {
|
||||||
]
|
"enum": [
|
||||||
]
|
[
|
||||||
|
false
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -379,13 +414,18 @@
|
|||||||
{
|
{
|
||||||
"description": "enum with true does not match 1",
|
"description": "enum with true does not match 1",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_7_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_7_0",
|
||||||
true
|
"schemas": {
|
||||||
]
|
"enum_7_0": {
|
||||||
|
"enum": [
|
||||||
|
true
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -420,15 +460,20 @@
|
|||||||
{
|
{
|
||||||
"description": "enum with [true] does not match [1]",
|
"description": "enum with [true] does not match [1]",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_8_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_8_0",
|
||||||
[
|
"schemas": {
|
||||||
true
|
"enum_8_0": {
|
||||||
]
|
"enum": [
|
||||||
]
|
[
|
||||||
|
true
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -469,13 +514,18 @@
|
|||||||
{
|
{
|
||||||
"description": "enum with 0 does not match false",
|
"description": "enum with 0 does not match false",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_9_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_9_0",
|
||||||
0
|
"schemas": {
|
||||||
]
|
"enum_9_0": {
|
||||||
|
"enum": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -510,15 +560,20 @@
|
|||||||
{
|
{
|
||||||
"description": "enum with [0] does not match [false]",
|
"description": "enum with [0] does not match [false]",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_10_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_10_0",
|
||||||
[
|
"schemas": {
|
||||||
0
|
"enum_10_0": {
|
||||||
]
|
"enum": [
|
||||||
]
|
[
|
||||||
|
0
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -559,13 +614,18 @@
|
|||||||
{
|
{
|
||||||
"description": "enum with 1 does not match true",
|
"description": "enum with 1 does not match true",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_11_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_11_0",
|
||||||
1
|
"schemas": {
|
||||||
]
|
"enum_11_0": {
|
||||||
|
"enum": [
|
||||||
|
1
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -600,15 +660,20 @@
|
|||||||
{
|
{
|
||||||
"description": "enum with [1] does not match [true]",
|
"description": "enum with [1] does not match [true]",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_12_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_12_0",
|
||||||
[
|
"schemas": {
|
||||||
1
|
"enum_12_0": {
|
||||||
]
|
"enum": [
|
||||||
]
|
[
|
||||||
|
1
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -649,13 +714,18 @@
|
|||||||
{
|
{
|
||||||
"description": "nul characters in strings",
|
"description": "nul characters in strings",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_13_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_13_0",
|
||||||
"hello\u0000there"
|
"schemas": {
|
||||||
]
|
"enum_13_0": {
|
||||||
|
"enum": [
|
||||||
|
"hello\u0000there"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -681,16 +751,21 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra properties in enum object match",
|
"description": "extensible: true allows extra properties in enum object match",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"enum_14_0": {
|
{
|
||||||
"enum": [
|
"name": "enum_14_0",
|
||||||
{
|
"schemas": {
|
||||||
"foo": 1
|
"enum_14_0": {
|
||||||
|
"enum": [
|
||||||
|
{
|
||||||
|
"foo": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extensible": true
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
"extensible": true
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,16 @@
|
|||||||
{
|
{
|
||||||
"description": "exclusiveMaximum validation",
|
"description": "exclusiveMaximum validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"exclusiveMaximum_0_0": {
|
{
|
||||||
"exclusiveMaximum": 3
|
"name": "exclusiveMaximum_0_0",
|
||||||
|
"schemas": {
|
||||||
|
"exclusiveMaximum_0_0": {
|
||||||
|
"exclusiveMaximum": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,16 @@
|
|||||||
{
|
{
|
||||||
"description": "exclusiveMinimum validation",
|
"description": "exclusiveMinimum validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"exclusiveMinimum_0_0": {
|
{
|
||||||
"exclusiveMinimum": 1.1
|
"name": "exclusiveMinimum_0_0",
|
||||||
|
"schemas": {
|
||||||
|
"exclusiveMinimum_0_0": {
|
||||||
|
"exclusiveMinimum": 1.1
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -94,19 +94,30 @@
|
|||||||
{
|
{
|
||||||
"id": "type3",
|
"id": "type3",
|
||||||
"type": "type",
|
"type": "type",
|
||||||
"name": "filter",
|
"name": "search",
|
||||||
"module": "core",
|
"module": "core",
|
||||||
"source": "filter",
|
"source": "search",
|
||||||
"hierarchy": [
|
"hierarchy": [
|
||||||
"filter"
|
"search"
|
||||||
],
|
],
|
||||||
"variations": [
|
"variations": [
|
||||||
"filter",
|
"search"
|
||||||
"string.condition",
|
|
||||||
"integer.condition",
|
|
||||||
"date.condition"
|
|
||||||
],
|
],
|
||||||
"schemas": {
|
"schemas": {
|
||||||
|
"search": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"filter": {
|
||||||
|
"type": "filter"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"filter": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -161,14 +172,50 @@
|
|||||||
"schemas": {
|
"schemas": {
|
||||||
"person": {},
|
"person": {},
|
||||||
"person.filter": {
|
"person.filter": {
|
||||||
"type": "object",
|
"type": "filter",
|
||||||
"compiledPropertyNames": [
|
"compiledPropertyNames": [
|
||||||
|
"$and",
|
||||||
|
"$or",
|
||||||
"age",
|
"age",
|
||||||
"billing_address",
|
"billing_address",
|
||||||
"birth_date",
|
"birth_date",
|
||||||
"first_name"
|
"first_name"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"$and": {
|
||||||
|
"type": [
|
||||||
|
"array",
|
||||||
|
"null"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"compiledPropertyNames": [
|
||||||
|
"$and",
|
||||||
|
"$or",
|
||||||
|
"age",
|
||||||
|
"billing_address",
|
||||||
|
"birth_date",
|
||||||
|
"first_name"
|
||||||
|
],
|
||||||
|
"type": "person.filter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$or": {
|
||||||
|
"type": [
|
||||||
|
"array",
|
||||||
|
"null"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"compiledPropertyNames": [
|
||||||
|
"$and",
|
||||||
|
"$or",
|
||||||
|
"age",
|
||||||
|
"billing_address",
|
||||||
|
"birth_date",
|
||||||
|
"first_name"
|
||||||
|
],
|
||||||
|
"type": "person.filter"
|
||||||
|
}
|
||||||
|
},
|
||||||
"first_name": {
|
"first_name": {
|
||||||
"type": [
|
"type": [
|
||||||
"string.condition",
|
"string.condition",
|
||||||
@ -197,11 +244,41 @@
|
|||||||
},
|
},
|
||||||
"address": {},
|
"address": {},
|
||||||
"address.filter": {
|
"address.filter": {
|
||||||
"type": "object",
|
"type": "filter",
|
||||||
"compiledPropertyNames": [
|
"compiledPropertyNames": [
|
||||||
|
"$and",
|
||||||
|
"$or",
|
||||||
"city"
|
"city"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"$and": {
|
||||||
|
"type": [
|
||||||
|
"array",
|
||||||
|
"null"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"compiledPropertyNames": [
|
||||||
|
"$and",
|
||||||
|
"$or",
|
||||||
|
"city"
|
||||||
|
],
|
||||||
|
"type": "address.filter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$or": {
|
||||||
|
"type": [
|
||||||
|
"array",
|
||||||
|
"null"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"compiledPropertyNames": [
|
||||||
|
"$and",
|
||||||
|
"$or",
|
||||||
|
"city"
|
||||||
|
],
|
||||||
|
"type": "address.filter"
|
||||||
|
}
|
||||||
|
},
|
||||||
"city": {
|
"city": {
|
||||||
"type": [
|
"type": [
|
||||||
"string.condition",
|
"string.condition",
|
||||||
@ -210,10 +287,65 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"filter": {},
|
||||||
"condition": {},
|
"condition": {},
|
||||||
"string.condition": {},
|
"string.condition": {},
|
||||||
"integer.condition": {},
|
"integer.condition": {},
|
||||||
"date.condition": {}
|
"date.condition": {},
|
||||||
|
"search": {},
|
||||||
|
"search.filter": {
|
||||||
|
"type": "filter",
|
||||||
|
"compiledPropertyNames": [
|
||||||
|
"$and",
|
||||||
|
"$or",
|
||||||
|
"filter",
|
||||||
|
"name"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"$and": {
|
||||||
|
"type": [
|
||||||
|
"array",
|
||||||
|
"null"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"compiledPropertyNames": [
|
||||||
|
"$and",
|
||||||
|
"$or",
|
||||||
|
"filter",
|
||||||
|
"name"
|
||||||
|
],
|
||||||
|
"type": "search.filter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$or": {
|
||||||
|
"type": [
|
||||||
|
"array",
|
||||||
|
"null"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"compiledPropertyNames": [
|
||||||
|
"$and",
|
||||||
|
"$or",
|
||||||
|
"filter",
|
||||||
|
"name"
|
||||||
|
],
|
||||||
|
"type": "search.filter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"filter": {
|
||||||
|
"type": [
|
||||||
|
"filter.filter",
|
||||||
|
"null"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": [
|
||||||
|
"string.condition",
|
||||||
|
"null"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -2,13 +2,18 @@
|
|||||||
{
|
{
|
||||||
"description": "a schema given for items",
|
"description": "a schema given for items",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_0_0": {
|
{
|
||||||
"items": {
|
"name": "items_0_0",
|
||||||
"type": "integer"
|
"schemas": {
|
||||||
|
"items_0_0": {
|
||||||
|
"items": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -64,11 +69,16 @@
|
|||||||
{
|
{
|
||||||
"description": "items with boolean schema (true)",
|
"description": "items with boolean schema (true)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_1_0": {
|
{
|
||||||
"items": true
|
"name": "items_1_0",
|
||||||
|
"schemas": {
|
||||||
|
"items_1_0": {
|
||||||
|
"items": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -98,11 +108,16 @@
|
|||||||
{
|
{
|
||||||
"description": "items with boolean schema (false)",
|
"description": "items with boolean schema (false)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_2_0": {
|
{
|
||||||
"items": false
|
"name": "items_2_0",
|
||||||
|
"schemas": {
|
||||||
|
"items_2_0": {
|
||||||
|
"items": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -132,41 +147,56 @@
|
|||||||
{
|
{
|
||||||
"description": "items and subitems",
|
"description": "items and subitems",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_3_0": {
|
{
|
||||||
"type": "array",
|
"name": "items_3_0",
|
||||||
"items": false,
|
"schemas": {
|
||||||
"prefixItems": [
|
"items_3_0": {
|
||||||
{
|
"type": "array",
|
||||||
"type": "item"
|
"items": false,
|
||||||
},
|
"prefixItems": [
|
||||||
{
|
{
|
||||||
"type": "item"
|
"type": "item"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "item"
|
"type": "item"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "item"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
},
|
},
|
||||||
"item": {
|
{
|
||||||
"type": "array",
|
"name": "item",
|
||||||
"items": false,
|
"schemas": {
|
||||||
"prefixItems": [
|
"item": {
|
||||||
{
|
"type": "array",
|
||||||
"type": "sub-item"
|
"items": false,
|
||||||
},
|
"prefixItems": [
|
||||||
{
|
{
|
||||||
"type": "sub-item"
|
"type": "sub-item"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "sub-item"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
},
|
},
|
||||||
"sub-item": {
|
{
|
||||||
"type": "object",
|
"name": "sub-item",
|
||||||
"required": [
|
"schemas": {
|
||||||
"foo"
|
"sub-item": {
|
||||||
]
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"foo"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -368,23 +398,28 @@
|
|||||||
{
|
{
|
||||||
"description": "nested items",
|
"description": "nested items",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_4_0": {
|
{
|
||||||
"type": "array",
|
"name": "items_4_0",
|
||||||
"items": {
|
"schemas": {
|
||||||
"type": "array",
|
"items_4_0": {
|
||||||
"items": {
|
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "number"
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -500,16 +535,21 @@
|
|||||||
{
|
{
|
||||||
"description": "prefixItems with no additional items allowed",
|
"description": "prefixItems with no additional items allowed",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_5_0": {
|
{
|
||||||
"prefixItems": [
|
"name": "items_5_0",
|
||||||
{},
|
"schemas": {
|
||||||
{},
|
"items_5_0": {
|
||||||
{}
|
"prefixItems": [
|
||||||
],
|
{},
|
||||||
"items": false
|
{},
|
||||||
|
{}
|
||||||
|
],
|
||||||
|
"items": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -576,22 +616,27 @@
|
|||||||
{
|
{
|
||||||
"description": "items does not look in applicators, valid case",
|
"description": "items does not look in applicators, valid case",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_6_0": {
|
{
|
||||||
"allOf": [
|
"name": "items_6_0",
|
||||||
{
|
"schemas": {
|
||||||
"prefixItems": [
|
"items_6_0": {
|
||||||
|
"allOf": [
|
||||||
{
|
{
|
||||||
"minimum": 3
|
"prefixItems": [
|
||||||
|
{
|
||||||
|
"minimum": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"items": {
|
||||||
|
"minimum": 5
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"items": {
|
|
||||||
"minimum": 5
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -623,18 +668,23 @@
|
|||||||
{
|
{
|
||||||
"description": "prefixItems validation adjusts the starting index for items",
|
"description": "prefixItems validation adjusts the starting index for items",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_7_0": {
|
{
|
||||||
"prefixItems": [
|
"name": "items_7_0",
|
||||||
{
|
"schemas": {
|
||||||
"type": "string"
|
"items_7_0": {
|
||||||
|
"prefixItems": [
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"items": {
|
|
||||||
"type": "integer"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -667,14 +717,19 @@
|
|||||||
{
|
{
|
||||||
"description": "items with heterogeneous array",
|
"description": "items with heterogeneous array",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_8_0": {
|
{
|
||||||
"prefixItems": [
|
"name": "items_8_0",
|
||||||
{}
|
"schemas": {
|
||||||
],
|
"items_8_0": {
|
||||||
"items": false
|
"prefixItems": [
|
||||||
|
{}
|
||||||
|
],
|
||||||
|
"items": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -706,13 +761,18 @@
|
|||||||
{
|
{
|
||||||
"description": "items with null instance elements",
|
"description": "items with null instance elements",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_9_0": {
|
{
|
||||||
"items": {
|
"name": "items_9_0",
|
||||||
"type": "null"
|
"schemas": {
|
||||||
|
"items_9_0": {
|
||||||
|
"items": {
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -731,12 +791,17 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra items (when items is false)",
|
"description": "extensible: true allows extra items (when items is false)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_10_0": {
|
{
|
||||||
"items": false,
|
"name": "items_10_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"items_10_0": {
|
||||||
|
"items": false,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -755,14 +820,19 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra properties for items",
|
"description": "extensible: true allows extra properties for items",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_11_0": {
|
{
|
||||||
"items": {
|
"name": "items_11_0",
|
||||||
"minimum": 5
|
"schemas": {
|
||||||
},
|
"items_11_0": {
|
||||||
"extensible": true
|
"items": {
|
||||||
|
"minimum": 5
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -793,12 +863,17 @@
|
|||||||
{
|
{
|
||||||
"description": "array: simple extensible array",
|
"description": "array: simple extensible array",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_12_0": {
|
{
|
||||||
"type": "array",
|
"name": "items_12_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"items_12_0": {
|
||||||
|
"type": "array",
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -827,12 +902,17 @@
|
|||||||
{
|
{
|
||||||
"description": "array: strict array",
|
"description": "array: strict array",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_13_0": {
|
{
|
||||||
"type": "array",
|
"name": "items_13_0",
|
||||||
"extensible": false
|
"schemas": {
|
||||||
|
"items_13_0": {
|
||||||
|
"type": "array",
|
||||||
|
"extensible": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -860,14 +940,19 @@
|
|||||||
{
|
{
|
||||||
"description": "array: items extensible",
|
"description": "array: items extensible",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_14_0": {
|
{
|
||||||
"type": "array",
|
"name": "items_14_0",
|
||||||
"items": {
|
"schemas": {
|
||||||
"extensible": true
|
"items_14_0": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -897,15 +982,20 @@
|
|||||||
{
|
{
|
||||||
"description": "array: items strict",
|
"description": "array: items strict",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"items_15_0": {
|
{
|
||||||
"type": "array",
|
"name": "items_15_0",
|
||||||
"items": {
|
"schemas": {
|
||||||
"type": "object",
|
"items_15_0": {
|
||||||
"extensible": false
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"extensible": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,12 +2,17 @@
|
|||||||
{
|
{
|
||||||
"description": "maxContains without contains is ignored",
|
"description": "maxContains without contains is ignored",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxContains_0_0": {
|
{
|
||||||
"maxContains": 1,
|
"name": "maxContains_0_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"maxContains_0_0": {
|
||||||
|
"maxContains": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -38,15 +43,20 @@
|
|||||||
{
|
{
|
||||||
"description": "maxContains with contains",
|
"description": "maxContains with contains",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxContains_1_0": {
|
{
|
||||||
"contains": {
|
"name": "maxContains_1_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"maxContains_1_0": {
|
||||||
"maxContains": 1,
|
"contains": {
|
||||||
"extensible": true
|
"const": 1
|
||||||
|
},
|
||||||
|
"maxContains": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -111,15 +121,20 @@
|
|||||||
{
|
{
|
||||||
"description": "maxContains with contains, value with a decimal",
|
"description": "maxContains with contains, value with a decimal",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxContains_2_0": {
|
{
|
||||||
"contains": {
|
"name": "maxContains_2_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"maxContains_2_0": {
|
||||||
"maxContains": 1,
|
"contains": {
|
||||||
"extensible": true
|
"const": 1
|
||||||
|
},
|
||||||
|
"maxContains": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -150,16 +165,21 @@
|
|||||||
{
|
{
|
||||||
"description": "minContains < maxContains",
|
"description": "minContains < maxContains",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxContains_3_0": {
|
{
|
||||||
"contains": {
|
"name": "maxContains_3_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"maxContains_3_0": {
|
||||||
"minContains": 1,
|
"contains": {
|
||||||
"maxContains": 3,
|
"const": 1
|
||||||
"extensible": true
|
},
|
||||||
|
"minContains": 1,
|
||||||
|
"maxContains": 3,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -202,15 +222,20 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows non-matching items in maxContains",
|
"description": "extensible: true allows non-matching items in maxContains",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxContains_4_0": {
|
{
|
||||||
"contains": {
|
"name": "maxContains_4_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"maxContains_4_0": {
|
||||||
"maxContains": 1,
|
"contains": {
|
||||||
"extensible": true
|
"const": 1
|
||||||
|
},
|
||||||
|
"maxContains": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,12 +2,17 @@
|
|||||||
{
|
{
|
||||||
"description": "maxItems validation",
|
"description": "maxItems validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxItems_0_0": {
|
{
|
||||||
"maxItems": 2,
|
"name": "maxItems_0_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"maxItems_0_0": {
|
||||||
|
"maxItems": 2,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -60,12 +65,17 @@
|
|||||||
{
|
{
|
||||||
"description": "maxItems validation with a decimal",
|
"description": "maxItems validation with a decimal",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxItems_1_0": {
|
{
|
||||||
"maxItems": 2,
|
"name": "maxItems_1_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"maxItems_1_0": {
|
||||||
|
"maxItems": 2,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -97,12 +107,17 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra items in maxItems (but counted)",
|
"description": "extensible: true allows extra items in maxItems (but counted)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxItems_2_0": {
|
{
|
||||||
"maxItems": 2,
|
"name": "maxItems_2_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"maxItems_2_0": {
|
||||||
|
"maxItems": 2,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,16 @@
|
|||||||
{
|
{
|
||||||
"description": "maxLength validation",
|
"description": "maxLength validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxLength_0_0": {
|
{
|
||||||
"maxLength": 2
|
"name": "maxLength_0_0",
|
||||||
|
"schemas": {
|
||||||
|
"maxLength_0_0": {
|
||||||
|
"maxLength": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -47,7 +52,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "two graphemes is long enough",
|
"description": "two graphemes is long enough",
|
||||||
"data": "💩💩",
|
"data": "\ud83d\udca9\ud83d\udca9",
|
||||||
"schema_id": "maxLength_0_0",
|
"schema_id": "maxLength_0_0",
|
||||||
"action": "validate",
|
"action": "validate",
|
||||||
"expect": {
|
"expect": {
|
||||||
@ -59,11 +64,16 @@
|
|||||||
{
|
{
|
||||||
"description": "maxLength validation with a decimal",
|
"description": "maxLength validation with a decimal",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxLength_1_0": {
|
{
|
||||||
"maxLength": 2
|
"name": "maxLength_1_0",
|
||||||
|
"schemas": {
|
||||||
|
"maxLength_1_0": {
|
||||||
|
"maxLength": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,12 +2,17 @@
|
|||||||
{
|
{
|
||||||
"description": "maxProperties validation",
|
"description": "maxProperties validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxProperties_0_0": {
|
{
|
||||||
"maxProperties": 2,
|
"name": "maxProperties_0_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"maxProperties_0_0": {
|
||||||
|
"maxProperties": 2,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -82,12 +87,17 @@
|
|||||||
{
|
{
|
||||||
"description": "maxProperties validation with a decimal",
|
"description": "maxProperties validation with a decimal",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxProperties_1_0": {
|
{
|
||||||
"maxProperties": 2,
|
"name": "maxProperties_1_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"maxProperties_1_0": {
|
||||||
|
"maxProperties": 2,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -119,12 +129,17 @@
|
|||||||
{
|
{
|
||||||
"description": "maxProperties = 0 means the object is empty",
|
"description": "maxProperties = 0 means the object is empty",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxProperties_2_0": {
|
{
|
||||||
"maxProperties": 0,
|
"name": "maxProperties_2_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"maxProperties_2_0": {
|
||||||
|
"maxProperties": 0,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -152,12 +167,17 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra properties in maxProperties (though maxProperties still counts them!)",
|
"description": "extensible: true allows extra properties in maxProperties (though maxProperties still counts them!)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maxProperties_3_0": {
|
{
|
||||||
"maxProperties": 2,
|
"name": "maxProperties_3_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"maxProperties_3_0": {
|
||||||
|
"maxProperties": 2,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,16 @@
|
|||||||
{
|
{
|
||||||
"description": "maximum validation",
|
"description": "maximum validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maximum_0_0": {
|
{
|
||||||
"maximum": 3
|
"name": "maximum_0_0",
|
||||||
|
"schemas": {
|
||||||
|
"maximum_0_0": {
|
||||||
|
"maximum": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -50,11 +55,16 @@
|
|||||||
{
|
{
|
||||||
"description": "maximum validation with unsigned integer",
|
"description": "maximum validation with unsigned integer",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"maximum_1_0": {
|
{
|
||||||
"maximum": 300
|
"name": "maximum_1_0",
|
||||||
|
"schemas": {
|
||||||
|
"maximum_1_0": {
|
||||||
|
"maximum": 300
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,23 +2,33 @@
|
|||||||
{
|
{
|
||||||
"description": "merging: properties accumulate",
|
"description": "merging: properties accumulate",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"base_0": {
|
{
|
||||||
"properties": {
|
"name": "base_0",
|
||||||
"base_prop": {
|
"schemas": {
|
||||||
"type": "string"
|
"base_0": {
|
||||||
|
"properties": {
|
||||||
|
"base_prop": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"merge_0_0": {
|
{
|
||||||
"type": "base_0",
|
"name": "merge_0_0",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"child_prop": {
|
"merge_0_0": {
|
||||||
"type": "string"
|
"type": "base_0",
|
||||||
|
"properties": {
|
||||||
|
"child_prop": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -58,29 +68,39 @@
|
|||||||
{
|
{
|
||||||
"description": "merging: required fields accumulate",
|
"description": "merging: required fields accumulate",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"base_1": {
|
{
|
||||||
"properties": {
|
"name": "base_1",
|
||||||
"a": {
|
"schemas": {
|
||||||
"type": "string"
|
"base_1": {
|
||||||
|
"properties": {
|
||||||
|
"a": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"a"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"required": [
|
|
||||||
"a"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"merge_1_0": {
|
{
|
||||||
"type": "base_1",
|
"name": "merge_1_0",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"b": {
|
"merge_1_0": {
|
||||||
"type": "string"
|
"type": "base_1",
|
||||||
|
"properties": {
|
||||||
|
"b": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"b"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"required": [
|
|
||||||
"b"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -138,36 +158,46 @@
|
|||||||
{
|
{
|
||||||
"description": "merging: dependencies accumulate",
|
"description": "merging: dependencies accumulate",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"base_2": {
|
{
|
||||||
"properties": {
|
"name": "base_2",
|
||||||
"trigger": {
|
"schemas": {
|
||||||
"type": "string"
|
"base_2": {
|
||||||
},
|
"properties": {
|
||||||
"base_dep": {
|
"trigger": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"base_dep": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"trigger": [
|
||||||
|
"base_dep"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"trigger": [
|
|
||||||
"base_dep"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"merge_2_0": {
|
{
|
||||||
"type": "base_2",
|
"name": "merge_2_0",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"child_dep": {
|
"merge_2_0": {
|
||||||
"type": "string"
|
"type": "base_2",
|
||||||
|
"properties": {
|
||||||
|
"child_dep": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"trigger": [
|
||||||
|
"child_dep"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"trigger": [
|
|
||||||
"child_dep"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -228,33 +258,43 @@
|
|||||||
{
|
{
|
||||||
"description": "merging: form and display do NOT merge",
|
"description": "merging: form and display do NOT merge",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"base_3": {
|
{
|
||||||
"properties": {
|
"name": "base_3",
|
||||||
"a": {
|
"schemas": {
|
||||||
"type": "string"
|
"base_3": {
|
||||||
},
|
"properties": {
|
||||||
"b": {
|
"a": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"b": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"form": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"form": [
|
|
||||||
"a",
|
|
||||||
"b"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"merge_3_0": {
|
{
|
||||||
"type": "base_3",
|
"name": "merge_3_0",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"c": {
|
"merge_3_0": {
|
||||||
"type": "string"
|
"type": "base_3",
|
||||||
|
"properties": {
|
||||||
|
"c": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"form": [
|
||||||
|
"c"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"form": [
|
|
||||||
"c"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,12 +2,17 @@
|
|||||||
{
|
{
|
||||||
"description": "minContains without contains is ignored",
|
"description": "minContains without contains is ignored",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minContains_0_0": {
|
{
|
||||||
"minContains": 1,
|
"name": "minContains_0_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"minContains_0_0": {
|
||||||
|
"minContains": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -35,15 +40,20 @@
|
|||||||
{
|
{
|
||||||
"description": "minContains=1 with contains",
|
"description": "minContains=1 with contains",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minContains_1_0": {
|
{
|
||||||
"contains": {
|
"name": "minContains_1_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"minContains_1_0": {
|
||||||
"minContains": 1,
|
"contains": {
|
||||||
"extensible": true
|
"const": 1
|
||||||
|
},
|
||||||
|
"minContains": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -106,15 +116,20 @@
|
|||||||
{
|
{
|
||||||
"description": "minContains=2 with contains",
|
"description": "minContains=2 with contains",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minContains_2_0": {
|
{
|
||||||
"contains": {
|
"name": "minContains_2_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"minContains_2_0": {
|
||||||
"minContains": 2,
|
"contains": {
|
||||||
"extensible": true
|
"const": 1
|
||||||
|
},
|
||||||
|
"minContains": 2,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -192,15 +207,20 @@
|
|||||||
{
|
{
|
||||||
"description": "minContains=2 with contains with a decimal value",
|
"description": "minContains=2 with contains with a decimal value",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minContains_3_0": {
|
{
|
||||||
"contains": {
|
"name": "minContains_3_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"minContains_3_0": {
|
||||||
"minContains": 2,
|
"contains": {
|
||||||
"extensible": true
|
"const": 1
|
||||||
|
},
|
||||||
|
"minContains": 2,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -231,16 +251,21 @@
|
|||||||
{
|
{
|
||||||
"description": "maxContains = minContains",
|
"description": "maxContains = minContains",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minContains_4_0": {
|
{
|
||||||
"contains": {
|
"name": "minContains_4_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"minContains_4_0": {
|
||||||
"maxContains": 2,
|
"contains": {
|
||||||
"minContains": 2,
|
"const": 1
|
||||||
"extensible": true
|
},
|
||||||
|
"maxContains": 2,
|
||||||
|
"minContains": 2,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -293,16 +318,21 @@
|
|||||||
{
|
{
|
||||||
"description": "maxContains < minContains",
|
"description": "maxContains < minContains",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minContains_5_0": {
|
{
|
||||||
"contains": {
|
"name": "minContains_5_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"minContains_5_0": {
|
||||||
"maxContains": 1,
|
"contains": {
|
||||||
"minContains": 3,
|
"const": 1
|
||||||
"extensible": true
|
},
|
||||||
|
"maxContains": 1,
|
||||||
|
"minContains": 3,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -355,15 +385,20 @@
|
|||||||
{
|
{
|
||||||
"description": "minContains = 0",
|
"description": "minContains = 0",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minContains_6_0": {
|
{
|
||||||
"contains": {
|
"name": "minContains_6_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"minContains_6_0": {
|
||||||
"minContains": 0,
|
"contains": {
|
||||||
"extensible": true
|
"const": 1
|
||||||
|
},
|
||||||
|
"minContains": 0,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -391,16 +426,21 @@
|
|||||||
{
|
{
|
||||||
"description": "minContains = 0 with maxContains",
|
"description": "minContains = 0 with maxContains",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minContains_7_0": {
|
{
|
||||||
"contains": {
|
"name": "minContains_7_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"minContains_7_0": {
|
||||||
"minContains": 0,
|
"contains": {
|
||||||
"maxContains": 1,
|
"const": 1
|
||||||
"extensible": true
|
},
|
||||||
|
"minContains": 0,
|
||||||
|
"maxContains": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -440,15 +480,20 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows non-matching items in minContains",
|
"description": "extensible: true allows non-matching items in minContains",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minContains_8_0": {
|
{
|
||||||
"contains": {
|
"name": "minContains_8_0",
|
||||||
"const": 1
|
"schemas": {
|
||||||
},
|
"minContains_8_0": {
|
||||||
"minContains": 1,
|
"contains": {
|
||||||
"extensible": true
|
"const": 1
|
||||||
|
},
|
||||||
|
"minContains": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,12 +2,17 @@
|
|||||||
{
|
{
|
||||||
"description": "minItems validation",
|
"description": "minItems validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minItems_0_0": {
|
{
|
||||||
"minItems": 1,
|
"name": "minItems_0_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"minItems_0_0": {
|
||||||
|
"minItems": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -56,12 +61,17 @@
|
|||||||
{
|
{
|
||||||
"description": "minItems validation with a decimal",
|
"description": "minItems validation with a decimal",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minItems_1_0": {
|
{
|
||||||
"minItems": 1,
|
"name": "minItems_1_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"minItems_1_0": {
|
||||||
|
"minItems": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -90,12 +100,17 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra items in minItems",
|
"description": "extensible: true allows extra items in minItems",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minItems_2_0": {
|
{
|
||||||
"minItems": 1,
|
"name": "minItems_2_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"minItems_2_0": {
|
||||||
|
"minItems": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,16 @@
|
|||||||
{
|
{
|
||||||
"description": "minLength validation",
|
"description": "minLength validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minLength_0_0": {
|
{
|
||||||
"minLength": 2
|
"name": "minLength_0_0",
|
||||||
|
"schemas": {
|
||||||
|
"minLength_0_0": {
|
||||||
|
"minLength": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -47,7 +52,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "one grapheme is not long enough",
|
"description": "one grapheme is not long enough",
|
||||||
"data": "💩",
|
"data": "\ud83d\udca9",
|
||||||
"schema_id": "minLength_0_0",
|
"schema_id": "minLength_0_0",
|
||||||
"action": "validate",
|
"action": "validate",
|
||||||
"expect": {
|
"expect": {
|
||||||
@ -59,11 +64,16 @@
|
|||||||
{
|
{
|
||||||
"description": "minLength validation with a decimal",
|
"description": "minLength validation with a decimal",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minLength_1_0": {
|
{
|
||||||
"minLength": 2
|
"name": "minLength_1_0",
|
||||||
|
"schemas": {
|
||||||
|
"minLength_1_0": {
|
||||||
|
"minLength": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,12 +2,17 @@
|
|||||||
{
|
{
|
||||||
"description": "minProperties validation",
|
"description": "minProperties validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minProperties_0_0": {
|
{
|
||||||
"minProperties": 1,
|
"name": "minProperties_0_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"minProperties_0_0": {
|
||||||
|
"minProperties": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -74,12 +79,17 @@
|
|||||||
{
|
{
|
||||||
"description": "minProperties validation with a decimal",
|
"description": "minProperties validation with a decimal",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minProperties_1_0": {
|
{
|
||||||
"minProperties": 1,
|
"name": "minProperties_1_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"minProperties_1_0": {
|
||||||
|
"minProperties": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -108,12 +118,17 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra properties in minProperties",
|
"description": "extensible: true allows extra properties in minProperties",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minProperties_2_0": {
|
{
|
||||||
"minProperties": 1,
|
"name": "minProperties_2_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"minProperties_2_0": {
|
||||||
|
"minProperties": 1,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,16 @@
|
|||||||
{
|
{
|
||||||
"description": "minimum validation",
|
"description": "minimum validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minimum_0_0": {
|
{
|
||||||
"minimum": 1.1
|
"name": "minimum_0_0",
|
||||||
|
"schemas": {
|
||||||
|
"minimum_0_0": {
|
||||||
|
"minimum": 1.1
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -50,11 +55,16 @@
|
|||||||
{
|
{
|
||||||
"description": "minimum validation with signed integer",
|
"description": "minimum validation with signed integer",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"minimum_1_0": {
|
{
|
||||||
"minimum": -2
|
"name": "minimum_1_0",
|
||||||
|
"schemas": {
|
||||||
|
"minimum_1_0": {
|
||||||
|
"minimum": -2
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,16 @@
|
|||||||
{
|
{
|
||||||
"description": "by int",
|
"description": "by int",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"multipleOf_0_0": {
|
{
|
||||||
"multipleOf": 2
|
"name": "multipleOf_0_0",
|
||||||
|
"schemas": {
|
||||||
|
"multipleOf_0_0": {
|
||||||
|
"multipleOf": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -41,11 +46,16 @@
|
|||||||
{
|
{
|
||||||
"description": "by number",
|
"description": "by number",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"multipleOf_1_0": {
|
{
|
||||||
"multipleOf": 1.5
|
"name": "multipleOf_1_0",
|
||||||
|
"schemas": {
|
||||||
|
"multipleOf_1_0": {
|
||||||
|
"multipleOf": 1.5
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -80,11 +90,16 @@
|
|||||||
{
|
{
|
||||||
"description": "by small number",
|
"description": "by small number",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"multipleOf_2_0": {
|
{
|
||||||
"multipleOf": 0.0001
|
"name": "multipleOf_2_0",
|
||||||
|
"schemas": {
|
||||||
|
"multipleOf_2_0": {
|
||||||
|
"multipleOf": 0.0001
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -110,12 +125,17 @@
|
|||||||
{
|
{
|
||||||
"description": "small multiple of large integer",
|
"description": "small multiple of large integer",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"multipleOf_3_0": {
|
{
|
||||||
"type": "integer",
|
"name": "multipleOf_3_0",
|
||||||
"multipleOf": 1e-08
|
"schemas": {
|
||||||
|
"multipleOf_3_0": {
|
||||||
|
"type": "integer",
|
||||||
|
"multipleOf": 1e-08
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,13 +2,18 @@
|
|||||||
{
|
{
|
||||||
"description": "not",
|
"description": "not",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"not_0_0": {
|
{
|
||||||
"not": {
|
"name": "not_0_0",
|
||||||
"type": "integer"
|
"schemas": {
|
||||||
|
"not_0_0": {
|
||||||
|
"not": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -34,16 +39,21 @@
|
|||||||
{
|
{
|
||||||
"description": "not multiple types",
|
"description": "not multiple types",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"not_1_0": {
|
{
|
||||||
"not": {
|
"name": "not_1_0",
|
||||||
"type": [
|
"schemas": {
|
||||||
"integer",
|
"not_1_0": {
|
||||||
"boolean"
|
"not": {
|
||||||
]
|
"type": [
|
||||||
|
"integer",
|
||||||
|
"boolean"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -78,19 +88,24 @@
|
|||||||
{
|
{
|
||||||
"description": "not more complex schema",
|
"description": "not more complex schema",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"not_2_0": {
|
{
|
||||||
"not": {
|
"name": "not_2_0",
|
||||||
"type": "object",
|
"schemas": {
|
||||||
"properties": {
|
"not_2_0": {
|
||||||
"foo": {
|
"not": {
|
||||||
"type": "string"
|
"type": "object",
|
||||||
}
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"extensible": true
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -129,15 +144,20 @@
|
|||||||
{
|
{
|
||||||
"description": "forbidden property",
|
"description": "forbidden property",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"not_3_0": {
|
{
|
||||||
"properties": {
|
"name": "not_3_0",
|
||||||
"foo": {
|
"schemas": {
|
||||||
"not": {}
|
"not_3_0": {
|
||||||
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"not": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -166,11 +186,16 @@
|
|||||||
{
|
{
|
||||||
"description": "forbid everything with empty schema",
|
"description": "forbid everything with empty schema",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"not_4_0": {
|
{
|
||||||
"not": {}
|
"name": "not_4_0",
|
||||||
|
"schemas": {
|
||||||
|
"not_4_0": {
|
||||||
|
"not": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -263,11 +288,16 @@
|
|||||||
{
|
{
|
||||||
"description": "forbid everything with boolean schema true",
|
"description": "forbid everything with boolean schema true",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"not_5_0": {
|
{
|
||||||
"not": true
|
"name": "not_5_0",
|
||||||
|
"schemas": {
|
||||||
|
"not_5_0": {
|
||||||
|
"not": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -360,12 +390,17 @@
|
|||||||
{
|
{
|
||||||
"description": "allow everything with boolean schema false",
|
"description": "allow everything with boolean schema false",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"not_6_0": {
|
{
|
||||||
"not": false,
|
"name": "not_6_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"not_6_0": {
|
||||||
|
"not": false,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -458,13 +493,18 @@
|
|||||||
{
|
{
|
||||||
"description": "double negation",
|
"description": "double negation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"not_7_0": {
|
{
|
||||||
"not": {
|
"name": "not_7_0",
|
||||||
"not": {}
|
"schemas": {
|
||||||
|
"not_7_0": {
|
||||||
|
"not": {
|
||||||
|
"not": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -481,14 +521,19 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra properties in not",
|
"description": "extensible: true allows extra properties in not",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"not_8_0": {
|
{
|
||||||
"not": {
|
"name": "not_8_0",
|
||||||
"type": "integer"
|
"schemas": {
|
||||||
},
|
"not_8_0": {
|
||||||
"extensible": true
|
"not": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -507,13 +552,18 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: false (default) forbids extra properties in not",
|
"description": "extensible: false (default) forbids extra properties in not",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"not_9_0": {
|
{
|
||||||
"not": {
|
"name": "not_9_0",
|
||||||
"type": "integer"
|
"schemas": {
|
||||||
|
"not_9_0": {
|
||||||
|
"not": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -532,19 +582,24 @@
|
|||||||
{
|
{
|
||||||
"description": "property next to not (extensible: true)",
|
"description": "property next to not (extensible: true)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"not_10_0": {
|
{
|
||||||
"properties": {
|
"name": "not_10_0",
|
||||||
"bar": {
|
"schemas": {
|
||||||
"type": "string"
|
"not_10_0": {
|
||||||
|
"properties": {
|
||||||
|
"bar": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"not": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"not": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"extensible": true
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -564,18 +619,23 @@
|
|||||||
{
|
{
|
||||||
"description": "property next to not (extensible: false)",
|
"description": "property next to not (extensible: false)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"not_11_0": {
|
{
|
||||||
"properties": {
|
"name": "not_11_0",
|
||||||
"bar": {
|
"schemas": {
|
||||||
"type": "string"
|
"not_11_0": {
|
||||||
|
"properties": {
|
||||||
|
"bar": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"not": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"not": {
|
|
||||||
"type": "integer"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,27 +2,37 @@
|
|||||||
{
|
{
|
||||||
"description": "Strict Inheritance",
|
"description": "Strict Inheritance",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"parent_type": {
|
{
|
||||||
"type": "object",
|
"name": "parent_type",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"a": {
|
"parent_type": {
|
||||||
"type": "integer"
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"a": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"a"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"required": [
|
|
||||||
"a"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"child_type": {
|
{
|
||||||
"type": "parent_type",
|
"name": "child_type",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"b": {
|
"child_type": {
|
||||||
"type": "integer"
|
"type": "parent_type",
|
||||||
|
"properties": {
|
||||||
|
"b": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -66,26 +76,36 @@
|
|||||||
{
|
{
|
||||||
"description": "Local Shadowing (Composition & Proxies)",
|
"description": "Local Shadowing (Composition & Proxies)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"budget": {
|
{
|
||||||
"type": "object",
|
"name": "budget",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"max": {
|
"budget": {
|
||||||
"type": "integer",
|
"type": "object",
|
||||||
"maximum": 100
|
"properties": {
|
||||||
|
"max": {
|
||||||
|
"type": "integer",
|
||||||
|
"maximum": 100
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"custom_budget": {
|
{
|
||||||
"type": "budget",
|
"name": "custom_budget",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"max": {
|
"custom_budget": {
|
||||||
"type": "integer",
|
"type": "budget",
|
||||||
"maximum": 50
|
"properties": {
|
||||||
|
"max": {
|
||||||
|
"type": "integer",
|
||||||
|
"maximum": 50
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -115,30 +135,40 @@
|
|||||||
{
|
{
|
||||||
"description": "Primitive Array Shorthand (Optionality)",
|
"description": "Primitive Array Shorthand (Optionality)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"invoice": {
|
{
|
||||||
"type": "object",
|
"name": "invoice",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"amount": {
|
"invoice": {
|
||||||
"type": "integer"
|
"type": "object",
|
||||||
}
|
"properties": {
|
||||||
},
|
"amount": {
|
||||||
"required": [
|
"type": "integer"
|
||||||
"amount"
|
}
|
||||||
]
|
},
|
||||||
},
|
"required": [
|
||||||
"request": {
|
"amount"
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"inv": {
|
|
||||||
"type": [
|
|
||||||
"invoice",
|
|
||||||
"null"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "request",
|
||||||
|
"schemas": {
|
||||||
|
"request": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"inv": {
|
||||||
|
"type": [
|
||||||
|
"invoice",
|
||||||
|
"null"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,63 +2,68 @@
|
|||||||
{
|
{
|
||||||
"description": "Hybrid Array Pathing",
|
"description": "Hybrid Array Pathing",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"hybrid_pathing": {
|
{
|
||||||
"type": "object",
|
"name": "hybrid_pathing",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"primitives": {
|
"hybrid_pathing": {
|
||||||
"type": "array",
|
"type": "object",
|
||||||
"items": {
|
"properties": {
|
||||||
"type": "string"
|
"primitives": {
|
||||||
}
|
"type": "array",
|
||||||
},
|
"items": {
|
||||||
"ad_hoc_objects": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"ad_hoc_objects": {
|
||||||
"name"
|
"type": "array",
|
||||||
]
|
"items": {
|
||||||
}
|
"type": "object",
|
||||||
},
|
"properties": {
|
||||||
"entities": {
|
"name": {
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": {
|
}
|
||||||
"type": "object",
|
},
|
||||||
"properties": {
|
"required": [
|
||||||
"id": {
|
"name"
|
||||||
"type": "string"
|
]
|
||||||
},
|
|
||||||
"value": {
|
|
||||||
"type": "number",
|
|
||||||
"minimum": 10
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
"entities": {
|
||||||
},
|
"type": "array",
|
||||||
"deep_entities": {
|
"items": {
|
||||||
"type": "array",
|
"type": "object",
|
||||||
"items": {
|
"properties": {
|
||||||
"type": "object",
|
"id": {
|
||||||
"properties": {
|
"type": "string"
|
||||||
"id": {
|
},
|
||||||
"type": "string"
|
"value": {
|
||||||
},
|
"type": "number",
|
||||||
"nested": {
|
"minimum": 10
|
||||||
"type": "array",
|
}
|
||||||
"items": {
|
}
|
||||||
"type": "object",
|
}
|
||||||
"properties": {
|
},
|
||||||
"id": {
|
"deep_entities": {
|
||||||
"type": "string"
|
"type": "array",
|
||||||
},
|
"items": {
|
||||||
"flag": {
|
"type": "object",
|
||||||
"type": "boolean"
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"nested": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"flag": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -68,7 +73,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -227,26 +232,31 @@
|
|||||||
{
|
{
|
||||||
"description": "Ad-Hoc Union Pathing",
|
"description": "Ad-Hoc Union Pathing",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"ad_hoc_pathing": {
|
{
|
||||||
"type": "object",
|
"name": "ad_hoc_pathing",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"metadata_bubbles": {
|
"ad_hoc_pathing": {
|
||||||
"type": "array",
|
"type": "object",
|
||||||
"items": {
|
"properties": {
|
||||||
"oneOf": [
|
"metadata_bubbles": {
|
||||||
{
|
"type": "array",
|
||||||
"type": "string"
|
"items": {
|
||||||
},
|
"oneOf": [
|
||||||
{
|
{
|
||||||
"type": "integer"
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -277,9 +287,22 @@
|
|||||||
{
|
{
|
||||||
"description": "Polymorphic Family Pathing",
|
"description": "Polymorphic Family Pathing",
|
||||||
"database": {
|
"database": {
|
||||||
|
"relations": [
|
||||||
|
{
|
||||||
|
"id": "11111111-1111-1111-1111-111111111111",
|
||||||
|
"type": "relation",
|
||||||
|
"constraint": "fk_family_pathing_table_families_widget",
|
||||||
|
"source_type": "widget",
|
||||||
|
"source_columns": ["family_pathing_id"],
|
||||||
|
"destination_type": "family_pathing",
|
||||||
|
"destination_columns": ["id"],
|
||||||
|
"prefix": "table_families"
|
||||||
|
}
|
||||||
|
],
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"name": "widget",
|
"name": "widget",
|
||||||
|
"hierarchy": ["widget"],
|
||||||
"variations": [
|
"variations": [
|
||||||
"widget"
|
"widget"
|
||||||
],
|
],
|
||||||
@ -322,21 +345,25 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
"schemas": {
|
"name": "family_pathing",
|
||||||
"family_pathing": {
|
"hierarchy": ["family_pathing"],
|
||||||
"type": "object",
|
"schemas": {
|
||||||
"properties": {
|
"family_pathing": {
|
||||||
"table_families": {
|
"type": "object",
|
||||||
"type": "array",
|
"properties": {
|
||||||
"items": {
|
"table_families": {
|
||||||
"family": "widget"
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"family": "widget"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,16 @@
|
|||||||
{
|
{
|
||||||
"description": "pattern validation",
|
"description": "pattern validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"pattern_0_0": {
|
{
|
||||||
"pattern": "^a*$"
|
"name": "pattern_0_0",
|
||||||
|
"schemas": {
|
||||||
|
"pattern_0_0": {
|
||||||
|
"pattern": "^a*$"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -86,11 +91,16 @@
|
|||||||
{
|
{
|
||||||
"description": "pattern is not anchored",
|
"description": "pattern is not anchored",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"pattern_1_0": {
|
{
|
||||||
"pattern": "a+"
|
"name": "pattern_1_0",
|
||||||
|
"schemas": {
|
||||||
|
"pattern_1_0": {
|
||||||
|
"pattern": "a+"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,16 +2,21 @@
|
|||||||
{
|
{
|
||||||
"description": "patternProperties validates properties matching a regex",
|
"description": "patternProperties validates properties matching a regex",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"patternProperties_0_0": {
|
{
|
||||||
"patternProperties": {
|
"name": "patternProperties_0_0",
|
||||||
"f.*o": {
|
"schemas": {
|
||||||
"type": "integer"
|
"patternProperties_0_0": {
|
||||||
|
"patternProperties": {
|
||||||
|
"f.*o": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"items": {}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"items": {}
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -107,18 +112,23 @@
|
|||||||
{
|
{
|
||||||
"description": "multiple simultaneous patternProperties are validated",
|
"description": "multiple simultaneous patternProperties are validated",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"patternProperties_1_0": {
|
{
|
||||||
"patternProperties": {
|
"name": "patternProperties_1_0",
|
||||||
"a*": {
|
"schemas": {
|
||||||
"type": "integer"
|
"patternProperties_1_0": {
|
||||||
},
|
"patternProperties": {
|
||||||
"aaa*": {
|
"a*": {
|
||||||
"maximum": 20
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"aaa*": {
|
||||||
|
"maximum": 20
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -194,19 +204,24 @@
|
|||||||
{
|
{
|
||||||
"description": "regexes are not anchored by default and are case sensitive",
|
"description": "regexes are not anchored by default and are case sensitive",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"patternProperties_2_0": {
|
{
|
||||||
"patternProperties": {
|
"name": "patternProperties_2_0",
|
||||||
"[0-9]{2,}": {
|
"schemas": {
|
||||||
"type": "boolean"
|
"patternProperties_2_0": {
|
||||||
},
|
"patternProperties": {
|
||||||
"X_": {
|
"[0-9]{2,}": {
|
||||||
"type": "string"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"X_": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"extensible": true
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -258,14 +273,19 @@
|
|||||||
{
|
{
|
||||||
"description": "patternProperties with boolean schemas",
|
"description": "patternProperties with boolean schemas",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"patternProperties_3_0": {
|
{
|
||||||
"patternProperties": {
|
"name": "patternProperties_3_0",
|
||||||
"f.*": true,
|
"schemas": {
|
||||||
"b.*": false
|
"patternProperties_3_0": {
|
||||||
|
"patternProperties": {
|
||||||
|
"f.*": true,
|
||||||
|
"b.*": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -327,15 +347,20 @@
|
|||||||
{
|
{
|
||||||
"description": "patternProperties with null valued instance properties",
|
"description": "patternProperties with null valued instance properties",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"patternProperties_4_0": {
|
{
|
||||||
"patternProperties": {
|
"name": "patternProperties_4_0",
|
||||||
"^.*bar$": {
|
"schemas": {
|
||||||
"type": "null"
|
"patternProperties_4_0": {
|
||||||
|
"patternProperties": {
|
||||||
|
"^.*bar$": {
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -354,16 +379,21 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra properties NOT matching pattern",
|
"description": "extensible: true allows extra properties NOT matching pattern",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"patternProperties_5_0": {
|
{
|
||||||
"patternProperties": {
|
"name": "patternProperties_5_0",
|
||||||
"f.*o": {
|
"schemas": {
|
||||||
"type": "integer"
|
"patternProperties_5_0": {
|
||||||
|
"patternProperties": {
|
||||||
|
"f.*o": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"extensible": true
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -73,13 +73,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "family_entity",
|
||||||
|
"schemas": {
|
||||||
|
"family_entity": {
|
||||||
|
"family": "entity"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"schemas": {
|
|
||||||
"family_entity": {
|
|
||||||
"family": "entity"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -222,13 +225,16 @@
|
|||||||
"type": "light.entity"
|
"type": "light.entity"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "family_light_org",
|
||||||
|
"schemas": {
|
||||||
|
"family_light_org": {
|
||||||
|
"family": "light.organization"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"schemas": {
|
|
||||||
"family_light_org": {
|
|
||||||
"family": "light.organization"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -315,16 +321,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
],
|
|
||||||
"schemas": {
|
|
||||||
"family_widget": {
|
|
||||||
"family": "widget"
|
|
||||||
},
|
},
|
||||||
"family_stock_widget": {
|
{
|
||||||
"family": "stock.widget"
|
"name": "family_widget",
|
||||||
|
"schemas": {
|
||||||
|
"family_widget": {
|
||||||
|
"family": "widget"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "family_stock_widget",
|
||||||
|
"schemas": {
|
||||||
|
"family_stock_widget": {
|
||||||
|
"family": "stock.widget"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -463,20 +477,23 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
"schemas": {
|
"name": "oneOf_union",
|
||||||
"oneOf_union": {
|
"schemas": {
|
||||||
"oneOf": [
|
"oneOf_union": {
|
||||||
{
|
"oneOf": [
|
||||||
"type": "full.person"
|
{
|
||||||
},
|
"type": "full.person"
|
||||||
{
|
},
|
||||||
"type": "full.bot"
|
{
|
||||||
|
"type": "full.bot"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -559,48 +576,58 @@
|
|||||||
{
|
{
|
||||||
"description": "JSONB Field Bubble oneOf Discrimination (Promoted IDs)",
|
"description": "JSONB Field Bubble oneOf Discrimination (Promoted IDs)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"metadata": {
|
{
|
||||||
"type": "object",
|
"name": "metadata",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"type": {
|
"metadata": {
|
||||||
"type": "string"
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"invoice.metadata": {
|
||||||
|
"type": "metadata",
|
||||||
|
"properties": {
|
||||||
|
"invoice_id": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"invoice_id"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"payment.metadata": {
|
||||||
|
"type": "metadata",
|
||||||
|
"properties": {
|
||||||
|
"payment_id": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"payment_id"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"invoice.metadata": {
|
{
|
||||||
"type": "metadata",
|
"name": "oneOf_bubble",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"invoice_id": {
|
"oneOf_bubble": {
|
||||||
"type": "integer"
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "invoice.metadata"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "payment.metadata"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"required": [
|
|
||||||
"invoice_id"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"payment.metadata": {
|
|
||||||
"type": "metadata",
|
|
||||||
"properties": {
|
|
||||||
"payment_id": {
|
|
||||||
"type": "integer"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"payment_id"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"oneOf_bubble": {
|
|
||||||
"oneOf": [
|
|
||||||
{
|
|
||||||
"type": "invoice.metadata"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "payment.metadata"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -675,16 +702,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
],
|
|
||||||
"schemas": {
|
|
||||||
"stock_widget_validation": {
|
|
||||||
"type": "stock.widget"
|
|
||||||
},
|
},
|
||||||
"projected_widget_validation": {
|
{
|
||||||
"type": "projected.widget"
|
"name": "stock_widget_validation",
|
||||||
|
"schemas": {
|
||||||
|
"stock_widget_validation": {
|
||||||
|
"type": "stock.widget"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "projected_widget_validation",
|
||||||
|
"schemas": {
|
||||||
|
"projected_widget_validation": {
|
||||||
|
"type": "projected.widget"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,18 +2,23 @@
|
|||||||
{
|
{
|
||||||
"description": "a schema given for prefixItems",
|
"description": "a schema given for prefixItems",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"prefixItems_0_0": {
|
{
|
||||||
"prefixItems": [
|
"name": "prefixItems_0_0",
|
||||||
{
|
"schemas": {
|
||||||
"type": "integer"
|
"prefixItems_0_0": {
|
||||||
},
|
"prefixItems": [
|
||||||
{
|
{
|
||||||
"type": "string"
|
"type": "integer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -91,14 +96,19 @@
|
|||||||
{
|
{
|
||||||
"description": "prefixItems with boolean schemas",
|
"description": "prefixItems with boolean schemas",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"prefixItems_1_0": {
|
{
|
||||||
"prefixItems": [
|
"name": "prefixItems_1_0",
|
||||||
true,
|
"schemas": {
|
||||||
false
|
"prefixItems_1_0": {
|
||||||
]
|
"prefixItems": [
|
||||||
|
true,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -138,16 +148,21 @@
|
|||||||
{
|
{
|
||||||
"description": "additional items are allowed by default",
|
"description": "additional items are allowed by default",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"prefixItems_2_0": {
|
{
|
||||||
"prefixItems": [
|
"name": "prefixItems_2_0",
|
||||||
{
|
"schemas": {
|
||||||
"type": "integer"
|
"prefixItems_2_0": {
|
||||||
|
"prefixItems": [
|
||||||
|
{
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extensible": true
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
"extensible": true
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -168,15 +183,20 @@
|
|||||||
{
|
{
|
||||||
"description": "prefixItems with null instance elements",
|
"description": "prefixItems with null instance elements",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"prefixItems_3_0": {
|
{
|
||||||
"prefixItems": [
|
"name": "prefixItems_3_0",
|
||||||
{
|
"schemas": {
|
||||||
"type": "null"
|
"prefixItems_3_0": {
|
||||||
|
"prefixItems": [
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -195,16 +215,21 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra items with prefixItems",
|
"description": "extensible: true allows extra items with prefixItems",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"prefixItems_4_0": {
|
{
|
||||||
"prefixItems": [
|
"name": "prefixItems_4_0",
|
||||||
{
|
"schemas": {
|
||||||
"type": "integer"
|
"prefixItems_4_0": {
|
||||||
|
"prefixItems": [
|
||||||
|
{
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extensible": true
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
"extensible": true
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,16 @@
|
|||||||
{
|
{
|
||||||
"description": "integer type matches integers",
|
"description": "integer type matches integers",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"type_0_0": {
|
{
|
||||||
"type": "integer"
|
"name": "type_0_0",
|
||||||
|
"schemas": {
|
||||||
|
"type_0_0": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -95,11 +100,16 @@
|
|||||||
{
|
{
|
||||||
"description": "number type matches numbers",
|
"description": "number type matches numbers",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"type_1_0": {
|
{
|
||||||
"type": "number"
|
"name": "type_1_0",
|
||||||
|
"schemas": {
|
||||||
|
"type_1_0": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -188,11 +198,16 @@
|
|||||||
{
|
{
|
||||||
"description": "string type matches strings",
|
"description": "string type matches strings",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"type_2_0": {
|
{
|
||||||
"type": "string"
|
"name": "type_2_0",
|
||||||
|
"schemas": {
|
||||||
|
"type_2_0": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -281,11 +296,16 @@
|
|||||||
{
|
{
|
||||||
"description": "object type matches objects",
|
"description": "object type matches objects",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"type_3_0": {
|
{
|
||||||
"type": "object"
|
"name": "type_3_0",
|
||||||
|
"schemas": {
|
||||||
|
"type_3_0": {
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -356,11 +376,16 @@
|
|||||||
{
|
{
|
||||||
"description": "array type matches arrays",
|
"description": "array type matches arrays",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"type_4_0": {
|
{
|
||||||
"type": "array"
|
"name": "type_4_0",
|
||||||
|
"schemas": {
|
||||||
|
"type_4_0": {
|
||||||
|
"type": "array"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -431,11 +456,16 @@
|
|||||||
{
|
{
|
||||||
"description": "boolean type matches booleans",
|
"description": "boolean type matches booleans",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"type_5_0": {
|
{
|
||||||
"type": "boolean"
|
"name": "type_5_0",
|
||||||
|
"schemas": {
|
||||||
|
"type_5_0": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -533,11 +563,16 @@
|
|||||||
{
|
{
|
||||||
"description": "null type matches only the null object",
|
"description": "null type matches only the null object",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"type_6_0": {
|
{
|
||||||
"type": "null"
|
"name": "type_6_0",
|
||||||
|
"schemas": {
|
||||||
|
"type_6_0": {
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -635,14 +670,19 @@
|
|||||||
{
|
{
|
||||||
"description": "multiple types can be specified in an array",
|
"description": "multiple types can be specified in an array",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"type_7_0": {
|
{
|
||||||
"type": [
|
"name": "type_7_0",
|
||||||
"integer",
|
"schemas": {
|
||||||
"string"
|
"type_7_0": {
|
||||||
]
|
"type": [
|
||||||
|
"integer",
|
||||||
|
"string"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -713,13 +753,18 @@
|
|||||||
{
|
{
|
||||||
"description": "type as array with one item",
|
"description": "type as array with one item",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"type_8_0": {
|
{
|
||||||
"type": [
|
"name": "type_8_0",
|
||||||
"string"
|
"schemas": {
|
||||||
]
|
"type_8_0": {
|
||||||
|
"type": [
|
||||||
|
"string"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -745,15 +790,20 @@
|
|||||||
{
|
{
|
||||||
"description": "type: array or object",
|
"description": "type: array or object",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"type_9_0": {
|
{
|
||||||
"type": [
|
"name": "type_9_0",
|
||||||
"array",
|
"schemas": {
|
||||||
"object"
|
"type_9_0": {
|
||||||
],
|
"type": [
|
||||||
"items": {}
|
"array",
|
||||||
|
"object"
|
||||||
|
],
|
||||||
|
"items": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -810,16 +860,21 @@
|
|||||||
{
|
{
|
||||||
"description": "type: array, object or null",
|
"description": "type: array, object or null",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"type_10_0": {
|
{
|
||||||
"type": [
|
"name": "type_10_0",
|
||||||
"array",
|
"schemas": {
|
||||||
"object",
|
"type_10_0": {
|
||||||
"null"
|
"type": [
|
||||||
],
|
"array",
|
||||||
"items": {}
|
"object",
|
||||||
|
"null"
|
||||||
|
],
|
||||||
|
"items": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -876,12 +931,17 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra properties",
|
"description": "extensible: true allows extra properties",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"type_11_0": {
|
{
|
||||||
"type": "object",
|
"name": "type_11_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"type_11_0": {
|
||||||
|
"type": "object",
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,18 +2,23 @@
|
|||||||
{
|
{
|
||||||
"description": "object properties validation",
|
"description": "object properties validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_0_0": {
|
{
|
||||||
"properties": {
|
"name": "properties_0_0",
|
||||||
"foo": {
|
"schemas": {
|
||||||
"type": "integer"
|
"properties_0_0": {
|
||||||
},
|
"properties": {
|
||||||
"bar": {
|
"foo": {
|
||||||
"type": "string"
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"bar": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -84,14 +89,19 @@
|
|||||||
{
|
{
|
||||||
"description": "properties with boolean schema",
|
"description": "properties with boolean schema",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_1_0": {
|
{
|
||||||
"properties": {
|
"name": "properties_1_0",
|
||||||
"foo": true,
|
"schemas": {
|
||||||
"bar": false
|
"properties_1_0": {
|
||||||
|
"properties": {
|
||||||
|
"foo": true,
|
||||||
|
"bar": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -142,30 +152,35 @@
|
|||||||
{
|
{
|
||||||
"description": "properties with escaped characters",
|
"description": "properties with escaped characters",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_2_0": {
|
{
|
||||||
"properties": {
|
"name": "properties_2_0",
|
||||||
"foo\nbar": {
|
"schemas": {
|
||||||
"type": "number"
|
"properties_2_0": {
|
||||||
},
|
"properties": {
|
||||||
"foo\"bar": {
|
"foo\nbar": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"foo\\bar": {
|
"foo\"bar": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"foo\rbar": {
|
"foo\\bar": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"foo\tbar": {
|
"foo\rbar": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"foo\fbar": {
|
"foo\tbar": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
|
},
|
||||||
|
"foo\fbar": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -205,15 +220,20 @@
|
|||||||
{
|
{
|
||||||
"description": "properties with null valued instance properties",
|
"description": "properties with null valued instance properties",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_3_0": {
|
{
|
||||||
"properties": {
|
"name": "properties_3_0",
|
||||||
"foo": {
|
"schemas": {
|
||||||
"type": "null"
|
"properties_3_0": {
|
||||||
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -233,25 +253,30 @@
|
|||||||
"description": "properties whose names are Javascript object property names",
|
"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.",
|
"comment": "Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object.",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_4_0": {
|
{
|
||||||
"properties": {
|
"name": "properties_4_0",
|
||||||
"__proto__": {
|
"schemas": {
|
||||||
"type": "number"
|
"properties_4_0": {
|
||||||
},
|
|
||||||
"toString": {
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"length": {
|
"__proto__": {
|
||||||
"type": "string"
|
"type": "number"
|
||||||
|
},
|
||||||
|
"toString": {
|
||||||
|
"properties": {
|
||||||
|
"length": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"constructor": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"constructor": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -338,16 +363,21 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra properties",
|
"description": "extensible: true allows extra properties",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_5_0": {
|
{
|
||||||
"properties": {
|
"name": "properties_5_0",
|
||||||
"foo": {
|
"schemas": {
|
||||||
"type": "integer"
|
"properties_5_0": {
|
||||||
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"extensible": true
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -367,15 +397,20 @@
|
|||||||
{
|
{
|
||||||
"description": "strict by default: extra properties invalid",
|
"description": "strict by default: extra properties invalid",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_6_0": {
|
{
|
||||||
"properties": {
|
"name": "properties_6_0",
|
||||||
"foo": {
|
"schemas": {
|
||||||
"type": "string"
|
"properties_6_0": {
|
||||||
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -395,19 +430,24 @@
|
|||||||
{
|
{
|
||||||
"description": "inheritance: nested object inherits strictness from strict parent",
|
"description": "inheritance: nested object inherits strictness from strict parent",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_7_0": {
|
{
|
||||||
"properties": {
|
"name": "properties_7_0",
|
||||||
"nested": {
|
"schemas": {
|
||||||
|
"properties_7_0": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"foo": {
|
"nested": {
|
||||||
"type": "string"
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -429,20 +469,25 @@
|
|||||||
{
|
{
|
||||||
"description": "override: nested object allows extra properties if extensible: true",
|
"description": "override: nested object allows extra properties if extensible: true",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_8_0": {
|
{
|
||||||
"properties": {
|
"name": "properties_8_0",
|
||||||
"nested": {
|
"schemas": {
|
||||||
"extensible": true,
|
"properties_8_0": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"foo": {
|
"nested": {
|
||||||
"type": "string"
|
"extensible": true,
|
||||||
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -464,20 +509,25 @@
|
|||||||
{
|
{
|
||||||
"description": "inheritance: nested object inherits looseness from loose parent",
|
"description": "inheritance: nested object inherits looseness from loose parent",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_9_0": {
|
{
|
||||||
"extensible": true,
|
"name": "properties_9_0",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"nested": {
|
"properties_9_0": {
|
||||||
|
"extensible": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"foo": {
|
"nested": {
|
||||||
"type": "string"
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -499,21 +549,26 @@
|
|||||||
{
|
{
|
||||||
"description": "override: nested object enforces strictness if extensible: false",
|
"description": "override: nested object enforces strictness if extensible: false",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_10_0": {
|
{
|
||||||
"extensible": true,
|
"name": "properties_10_0",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"nested": {
|
"properties_10_0": {
|
||||||
"extensible": false,
|
"extensible": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"foo": {
|
"nested": {
|
||||||
"type": "string"
|
"extensible": false,
|
||||||
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -535,22 +590,27 @@
|
|||||||
{
|
{
|
||||||
"description": "arrays: inline items inherit strictness from strict parent",
|
"description": "arrays: inline items inherit strictness from strict parent",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_11_0": {
|
{
|
||||||
"properties": {
|
"name": "properties_11_0",
|
||||||
"list": {
|
"schemas": {
|
||||||
"type": "array",
|
"properties_11_0": {
|
||||||
"items": {
|
"properties": {
|
||||||
"properties": {
|
"list": {
|
||||||
"foo": {
|
"type": "array",
|
||||||
"type": "string"
|
"items": {
|
||||||
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -574,23 +634,28 @@
|
|||||||
{
|
{
|
||||||
"description": "arrays: inline items inherit looseness from loose parent",
|
"description": "arrays: inline items inherit looseness from loose parent",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"properties_12_0": {
|
{
|
||||||
"extensible": true,
|
"name": "properties_12_0",
|
||||||
"properties": {
|
"schemas": {
|
||||||
"list": {
|
"properties_12_0": {
|
||||||
"type": "array",
|
"extensible": true,
|
||||||
"items": {
|
"properties": {
|
||||||
"properties": {
|
"list": {
|
||||||
"foo": {
|
"type": "array",
|
||||||
"type": "string"
|
"items": {
|
||||||
|
"properties": {
|
||||||
|
"foo": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,14 +2,19 @@
|
|||||||
{
|
{
|
||||||
"description": "propertyNames validation",
|
"description": "propertyNames validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"propertyNames_0_0": {
|
{
|
||||||
"propertyNames": {
|
"name": "propertyNames_0_0",
|
||||||
"maxLength": 3
|
"schemas": {
|
||||||
},
|
"propertyNames_0_0": {
|
||||||
"extensible": true
|
"propertyNames": {
|
||||||
|
"maxLength": 3
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -82,14 +87,19 @@
|
|||||||
{
|
{
|
||||||
"description": "propertyNames validation with pattern",
|
"description": "propertyNames validation with pattern",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"propertyNames_1_0": {
|
{
|
||||||
"propertyNames": {
|
"name": "propertyNames_1_0",
|
||||||
"pattern": "^a+$"
|
"schemas": {
|
||||||
},
|
"propertyNames_1_0": {
|
||||||
"extensible": true
|
"propertyNames": {
|
||||||
|
"pattern": "^a+$"
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -130,12 +140,17 @@
|
|||||||
{
|
{
|
||||||
"description": "propertyNames with boolean schema true",
|
"description": "propertyNames with boolean schema true",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"propertyNames_2_0": {
|
{
|
||||||
"propertyNames": true,
|
"name": "propertyNames_2_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"propertyNames_2_0": {
|
||||||
|
"propertyNames": true,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -163,12 +178,17 @@
|
|||||||
{
|
{
|
||||||
"description": "propertyNames with boolean schema false",
|
"description": "propertyNames with boolean schema false",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"propertyNames_3_0": {
|
{
|
||||||
"propertyNames": false,
|
"name": "propertyNames_3_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"propertyNames_3_0": {
|
||||||
|
"propertyNames": false,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -196,14 +216,19 @@
|
|||||||
{
|
{
|
||||||
"description": "propertyNames with const",
|
"description": "propertyNames with const",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"propertyNames_4_0": {
|
{
|
||||||
"propertyNames": {
|
"name": "propertyNames_4_0",
|
||||||
"const": "foo"
|
"schemas": {
|
||||||
},
|
"propertyNames_4_0": {
|
||||||
"extensible": true
|
"propertyNames": {
|
||||||
|
"const": "foo"
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -242,17 +267,22 @@
|
|||||||
{
|
{
|
||||||
"description": "propertyNames with enum",
|
"description": "propertyNames with enum",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"propertyNames_5_0": {
|
{
|
||||||
"propertyNames": {
|
"name": "propertyNames_5_0",
|
||||||
"enum": [
|
"schemas": {
|
||||||
"foo",
|
"propertyNames_5_0": {
|
||||||
"bar"
|
"propertyNames": {
|
||||||
]
|
"enum": [
|
||||||
},
|
"foo",
|
||||||
"extensible": true
|
"bar"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -303,14 +333,19 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra properties (checked by propertyNames)",
|
"description": "extensible: true allows extra properties (checked by propertyNames)",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"propertyNames_6_0": {
|
{
|
||||||
"propertyNames": {
|
"name": "propertyNames_6_0",
|
||||||
"maxLength": 3
|
"schemas": {
|
||||||
},
|
"propertyNames_6_0": {
|
||||||
"extensible": true
|
"propertyNames": {
|
||||||
|
"maxLength": 3
|
||||||
|
},
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1195,7 +1195,7 @@
|
|||||||
"description": "Simple entity select with multiple filters",
|
"description": "Simple entity select with multiple filters",
|
||||||
"action": "query",
|
"action": "query",
|
||||||
"schema_id": "entity",
|
"schema_id": "entity",
|
||||||
"filters": {
|
"filter": {
|
||||||
"id": {
|
"id": {
|
||||||
"$eq": "123e4567-e89b-12d3-a456-426614174000",
|
"$eq": "123e4567-e89b-12d3-a456-426614174000",
|
||||||
"$ne": "123e4567-e89b-12d3-a456-426614174001",
|
"$ne": "123e4567-e89b-12d3-a456-426614174001",
|
||||||
@ -1443,7 +1443,7 @@
|
|||||||
"description": "Person select on full schema with filters",
|
"description": "Person select on full schema with filters",
|
||||||
"action": "query",
|
"action": "query",
|
||||||
"schema_id": "full.person",
|
"schema_id": "full.person",
|
||||||
"filters": {
|
"filter": {
|
||||||
"age": {
|
"age": {
|
||||||
"$eq": 30,
|
"$eq": 30,
|
||||||
"$gt": 20,
|
"$gt": 20,
|
||||||
|
|||||||
@ -2,17 +2,22 @@
|
|||||||
{
|
{
|
||||||
"description": "required validation",
|
"description": "required validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"required_0_0": {
|
{
|
||||||
"properties": {
|
"name": "required_0_0",
|
||||||
"foo": {},
|
"schemas": {
|
||||||
"bar": {}
|
"required_0_0": {
|
||||||
},
|
"properties": {
|
||||||
"required": [
|
"foo": {},
|
||||||
"foo"
|
"bar": {}
|
||||||
]
|
},
|
||||||
|
"required": [
|
||||||
|
"foo"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -87,13 +92,18 @@
|
|||||||
{
|
{
|
||||||
"description": "required default validation",
|
"description": "required default validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"required_1_0": {
|
{
|
||||||
"properties": {
|
"name": "required_1_0",
|
||||||
"foo": {}
|
"schemas": {
|
||||||
|
"required_1_0": {
|
||||||
|
"properties": {
|
||||||
|
"foo": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -110,14 +120,19 @@
|
|||||||
{
|
{
|
||||||
"description": "required with empty array",
|
"description": "required with empty array",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"required_2_0": {
|
{
|
||||||
"properties": {
|
"name": "required_2_0",
|
||||||
"foo": {}
|
"schemas": {
|
||||||
},
|
"required_2_0": {
|
||||||
"required": []
|
"properties": {
|
||||||
|
"foo": {}
|
||||||
|
},
|
||||||
|
"required": []
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -134,19 +149,24 @@
|
|||||||
{
|
{
|
||||||
"description": "required with escaped characters",
|
"description": "required with escaped characters",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"required_3_0": {
|
{
|
||||||
"required": [
|
"name": "required_3_0",
|
||||||
"foo\nbar",
|
"schemas": {
|
||||||
"foo\"bar",
|
"required_3_0": {
|
||||||
"foo\\bar",
|
"required": [
|
||||||
"foo\rbar",
|
"foo\nbar",
|
||||||
"foo\tbar",
|
"foo\"bar",
|
||||||
"foo\fbar"
|
"foo\\bar",
|
||||||
],
|
"foo\rbar",
|
||||||
"extensible": true
|
"foo\tbar",
|
||||||
|
"foo\fbar"
|
||||||
|
],
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -183,16 +203,21 @@
|
|||||||
"description": "required properties whose names are Javascript object property names",
|
"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.",
|
"comment": "Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object.",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"required_4_0": {
|
{
|
||||||
"required": [
|
"name": "required_4_0",
|
||||||
"__proto__",
|
"schemas": {
|
||||||
"toString",
|
"required_4_0": {
|
||||||
"constructor"
|
"required": [
|
||||||
],
|
"__proto__",
|
||||||
"extensible": true
|
"toString",
|
||||||
|
"constructor"
|
||||||
|
],
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -279,14 +304,19 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra properties in required",
|
"description": "extensible: true allows extra properties in required",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"required_5_0": {
|
{
|
||||||
"required": [
|
"name": "required_5_0",
|
||||||
"foo"
|
"schemas": {
|
||||||
],
|
"required_5_0": {
|
||||||
"extensible": true
|
"required": [
|
||||||
|
"foo"
|
||||||
|
],
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,12 +2,17 @@
|
|||||||
{
|
{
|
||||||
"description": "uniqueItems validation",
|
"description": "uniqueItems validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"uniqueItems_0_0": {
|
{
|
||||||
"uniqueItems": true,
|
"name": "uniqueItems_0_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"uniqueItems_0_0": {
|
||||||
|
"uniqueItems": true,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -468,20 +473,25 @@
|
|||||||
{
|
{
|
||||||
"description": "uniqueItems with an array of items",
|
"description": "uniqueItems with an array of items",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"uniqueItems_1_0": {
|
{
|
||||||
"prefixItems": [
|
"name": "uniqueItems_1_0",
|
||||||
{
|
"schemas": {
|
||||||
"type": "boolean"
|
"uniqueItems_1_0": {
|
||||||
},
|
"prefixItems": [
|
||||||
{
|
{
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"uniqueItems": true,
|
||||||
|
"extensible": true
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
"uniqueItems": true,
|
|
||||||
"extensible": true
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -593,20 +603,25 @@
|
|||||||
{
|
{
|
||||||
"description": "uniqueItems with an array of items and additionalItems=false",
|
"description": "uniqueItems with an array of items and additionalItems=false",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"uniqueItems_2_0": {
|
{
|
||||||
"prefixItems": [
|
"name": "uniqueItems_2_0",
|
||||||
{
|
"schemas": {
|
||||||
"type": "boolean"
|
"uniqueItems_2_0": {
|
||||||
},
|
"prefixItems": [
|
||||||
{
|
{
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"uniqueItems": true,
|
||||||
|
"items": false
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
"uniqueItems": true,
|
|
||||||
"items": false
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -675,12 +690,17 @@
|
|||||||
{
|
{
|
||||||
"description": "uniqueItems=false validation",
|
"description": "uniqueItems=false validation",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"uniqueItems_3_0": {
|
{
|
||||||
"uniqueItems": false,
|
"name": "uniqueItems_3_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"uniqueItems_3_0": {
|
||||||
|
"uniqueItems": false,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -920,20 +940,25 @@
|
|||||||
{
|
{
|
||||||
"description": "uniqueItems=false with an array of items",
|
"description": "uniqueItems=false with an array of items",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"uniqueItems_4_0": {
|
{
|
||||||
"prefixItems": [
|
"name": "uniqueItems_4_0",
|
||||||
{
|
"schemas": {
|
||||||
"type": "boolean"
|
"uniqueItems_4_0": {
|
||||||
},
|
"prefixItems": [
|
||||||
{
|
{
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"uniqueItems": false,
|
||||||
|
"extensible": true
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
"uniqueItems": false,
|
|
||||||
"extensible": true
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -1045,20 +1070,25 @@
|
|||||||
{
|
{
|
||||||
"description": "uniqueItems=false with an array of items and additionalItems=false",
|
"description": "uniqueItems=false with an array of items and additionalItems=false",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"uniqueItems_5_0": {
|
{
|
||||||
"prefixItems": [
|
"name": "uniqueItems_5_0",
|
||||||
{
|
"schemas": {
|
||||||
"type": "boolean"
|
"uniqueItems_5_0": {
|
||||||
},
|
"prefixItems": [
|
||||||
{
|
{
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"uniqueItems": false,
|
||||||
|
"items": false
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
"uniqueItems": false,
|
|
||||||
"items": false
|
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
@ -1127,12 +1157,17 @@
|
|||||||
{
|
{
|
||||||
"description": "extensible: true allows extra items in uniqueItems",
|
"description": "extensible: true allows extra items in uniqueItems",
|
||||||
"database": {
|
"database": {
|
||||||
"schemas": {
|
"types": [
|
||||||
"uniqueItems_6_0": {
|
{
|
||||||
"uniqueItems": true,
|
"name": "uniqueItems_6_0",
|
||||||
"extensible": true
|
"schemas": {
|
||||||
|
"uniqueItems_6_0": {
|
||||||
|
"uniqueItems": true,
|
||||||
|
"extensible": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
|
|||||||
23
log.txt
Normal file
23
log.txt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.60s
|
||||||
|
Running unittests src/lib.rs (target/debug/deps/jspg-d3f18ff3a7e2b386)
|
||||||
|
|
||||||
|
running 1 test
|
||||||
|
test tests::test_library_api ... FAILED
|
||||||
|
|
||||||
|
failures:
|
||||||
|
|
||||||
|
---- tests::test_library_api stdout ----
|
||||||
|
|
||||||
|
thread 'tests::test_library_api' (110325727) panicked at src/tests/mod.rs:86:3:
|
||||||
|
assertion `left == right` failed
|
||||||
|
left: Object {"response": Object {"enums": Object {}, "puncs": Object {}, "relations": Object {"fk_test_target": Object {"constraint": String("fk_test_target"), "destination_columns": Array [String("id")], "destination_type": String("target_schema"), "id": String("11111111-1111-1111-1111-111111111111"), "prefix": String("target"), "source_columns": Array [String("target_id")], "source_type": String("source_schema"), "type": String("relation")}}, "types": Object {"source_schema": Object {"default_fields": Array [], "field_types": Null, "fields": Array [], "grouped_fields": Null, "hierarchy": Array [String("source_schema"), String("entity")], "historical": Bool(false), "id": String(""), "longevity": Null, "lookup_fields": Array [], "module": String(""), "name": String("source_schema"), "notify": Bool(false), "null_fields": Array [], "ownable": Bool(false), "relationship": Bool(false), "schemas": Object {"source_schema": Object {"compiledEdges": Object {"target": Object {"constraint": String("fk_test_target"), "forward": Bool(true)}}, "compiledPropertyNames": Array [String("name"), String("target"), String("type")], "properties": Object {"name": Object {"type": String("string")}, "target": Object {"compiledPropertyNames": Array [String("value")], "type": String("target_schema")}, "type": Object {"type": String("string")}}, "required": Array [String("name")], "type": String("object")}, "source_schema.filter": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("name"), String("target"), String("type")], "properties": Object {"$and": Object {"items": Object {"type": String("source_schema.filter")}, "type": Array [String("array"), String("null")]}, "$or": Object {"items": Object {"type": String("source_schema.filter")}, "type": Array [String("array"), String("null")]}, "name": Object {"type": Array [String("string.condition"), String("null")]}, "target": Object {"type": Array [String("target_schema.filter"), String("null")]}, "type": Object {"type": Array [String("string.condition"), String("null")]}}, "type": String("filter")}}, "sensitive": Bool(false), "source": String(""), "type": String(""), "variations": Array [String("source_schema")]}, "target_schema": Object {"default_fields": Array [], "field_types": Null, "fields": Array [], "grouped_fields": Null, "hierarchy": Array [String("target_schema"), String("entity")], "historical": Bool(false), "id": String(""), "longevity": Null, "lookup_fields": Array [], "module": String(""), "name": String("target_schema"), "notify": Bool(false), "null_fields": Array [], "ownable": Bool(false), "relationship": Bool(false), "schemas": Object {"target_schema": Object {"compiledPropertyNames": Array [String("value")], "properties": Object {"value": Object {"type": String("number")}}, "type": String("object")}, "target_schema.filter": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("value")], "properties": Object {"$and": Object {"items": Object {"type": String("target_schema.filter")}, "type": Array [String("array"), String("null")]}, "$or": Object {"items": Object {"type": String("target_schema.filter")}, "type": Array [String("array"), String("null")]}, "value": Object {"type": Array [String("number.condition"), String("null")]}}, "type": String("filter")}}, "sensitive": Bool(false), "source": String(""), "type": String(""), "variations": Array [String("target_schema")]}}}, "type": String("drop")}
|
||||||
|
right: Object {"response": Object {"enums": Object {}, "puncs": Object {}, "relations": Object {"fk_test_target": Object {"constraint": String("fk_test_target"), "destination_columns": Array [String("id")], "destination_type": String("target_schema"), "id": String("11111111-1111-1111-1111-111111111111"), "prefix": String("target"), "source_columns": Array [String("target_id")], "source_type": String("source_schema"), "type": String("relation")}}, "types": Object {"source_schema": Object {"default_fields": Array [], "field_types": Null, "fields": Array [], "grouped_fields": Null, "hierarchy": Array [String("source_schema"), String("entity")], "historical": Bool(false), "id": String(""), "longevity": Null, "lookup_fields": Array [], "module": String(""), "name": String("source_schema"), "notify": Bool(false), "null_fields": Array [], "ownable": Bool(false), "relationship": Bool(false), "schemas": Object {"source_schema": Object {"compiledEdges": Object {"target": Object {"constraint": String("fk_test_target"), "forward": Bool(true)}}, "compiledPropertyNames": Array [String("name"), String("target"), String("type")], "properties": Object {"name": Object {"type": String("string")}, "target": Object {"compiledPropertyNames": Array [String("value")], "type": String("target_schema")}, "type": Object {"type": String("string")}}, "required": Array [String("name")], "type": String("object")}, "source_schema.filter": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("name"), String("target"), String("type")], "properties": Object {"$and": Object {"items": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("name"), String("target"), String("type")], "type": String("source_schema.filter")}, "type": Array [String("array"), String("null")]}, "$or": Object {"items": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("name"), String("target"), String("type")], "type": String("source_schema.filter")}, "type": Array [String("array"), String("null")]}, "name": Object {"type": Array [String("string.condition"), String("null")]}, "target": Object {"type": Array [String("target_schema.filter"), String("null")]}, "type": Object {"type": Array [String("string.condition"), String("null")]}}, "type": String("filter")}}, "sensitive": Bool(false), "source": String(""), "type": String(""), "variations": Array [String("source_schema")]}, "target_schema": Object {"default_fields": Array [], "field_types": Null, "fields": Array [], "grouped_fields": Null, "hierarchy": Array [String("target_schema"), String("entity")], "historical": Bool(false), "id": String(""), "longevity": Null, "lookup_fields": Array [], "module": String(""), "name": String("target_schema"), "notify": Bool(false), "null_fields": Array [], "ownable": Bool(false), "relationship": Bool(false), "schemas": Object {"target_schema": Object {"compiledPropertyNames": Array [String("value")], "properties": Object {"value": Object {"type": String("number")}}, "type": String("object")}, "target_schema.filter": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("value")], "properties": Object {"$and": Object {"items": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("value")], "type": String("target_schema.filter")}, "type": Array [String("array"), String("null")]}, "$or": Object {"items": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("value")], "type": String("target_schema.filter")}, "type": Array [String("array"), String("null")]}, "value": Object {"type": Array [String("number.condition"), String("null")]}}, "type": String("filter")}}, "sensitive": Bool(false), "source": String(""), "type": String(""), "variations": Array [String("target_schema")]}}}, "type": String("drop")}
|
||||||
|
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||||
|
|
||||||
|
|
||||||
|
failures:
|
||||||
|
tests::test_library_api
|
||||||
|
|
||||||
|
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1357 filtered out; finished in 0.00s
|
||||||
|
|
||||||
|
error: test failed, to rerun pass `--lib`
|
||||||
23
log_test.txt
Normal file
23
log_test.txt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.35s
|
||||||
|
Running unittests src/lib.rs (target/debug/deps/jspg-d3f18ff3a7e2b386)
|
||||||
|
|
||||||
|
running 1 test
|
||||||
|
test tests::test_library_api ... FAILED
|
||||||
|
|
||||||
|
failures:
|
||||||
|
|
||||||
|
---- tests::test_library_api stdout ----
|
||||||
|
|
||||||
|
thread 'tests::test_library_api' (110334696) panicked at src/tests/mod.rs:86:3:
|
||||||
|
assertion `left == right` failed
|
||||||
|
left: Object {"response": Object {"enums": Object {}, "puncs": Object {}, "relations": Object {"fk_test_target": Object {"constraint": String("fk_test_target"), "destination_columns": Array [String("id")], "destination_type": String("target_schema"), "id": String("11111111-1111-1111-1111-111111111111"), "prefix": String("target"), "source_columns": Array [String("target_id")], "source_type": String("source_schema"), "type": String("relation")}}, "types": Object {"source_schema": Object {"default_fields": Array [], "field_types": Null, "fields": Array [], "grouped_fields": Null, "hierarchy": Array [String("source_schema"), String("entity")], "historical": Bool(false), "id": String(""), "longevity": Null, "lookup_fields": Array [], "module": String(""), "name": String("source_schema"), "notify": Bool(false), "null_fields": Array [], "ownable": Bool(false), "relationship": Bool(false), "schemas": Object {"source_schema": Object {"compiledEdges": Object {"target": Object {"constraint": String("fk_test_target"), "forward": Bool(true)}}, "compiledPropertyNames": Array [String("name"), String("target"), String("type")], "properties": Object {"name": Object {"type": String("string")}, "target": Object {"compiledPropertyNames": Array [String("value")], "type": String("target_schema")}, "type": Object {"type": String("string")}}, "required": Array [String("name")], "type": String("object")}, "source_schema.filter": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("name"), String("target"), String("type")], "properties": Object {"$and": Object {"items": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("name"), String("target"), String("type")], "type": String("source_schema.filter")}, "type": Array [String("array"), String("null")]}, "$or": Object {"items": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("name"), String("target"), String("type")], "type": String("source_schema.filter")}, "type": Array [String("array"), String("null")]}, "name": Object {"type": Array [String("string.condition"), String("null")]}, "target": Object {"type": Array [String("target_schema.filter"), String("null")]}, "type": Object {"type": Array [String("string.condition"), String("null")]}}, "type": String("filter")}}, "sensitive": Bool(false), "source": String(""), "type": String(""), "variations": Array [String("source_schema")]}, "target_schema": Object {"default_fields": Array [], "field_types": Null, "fields": Array [], "grouped_fields": Null, "hierarchy": Array [String("target_schema"), String("entity")], "historical": Bool(false), "id": String(""), "longevity": Null, "lookup_fields": Array [], "module": String(""), "name": String("target_schema"), "notify": Bool(false), "null_fields": Array [], "ownable": Bool(false), "relationship": Bool(false), "schemas": Object {"target_schema": Object {"compiledPropertyNames": Array [String("value")], "properties": Object {"value": Object {"type": String("number")}}, "type": String("object")}, "target_schema.filter": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("value")], "properties": Object {"$and": Object {"items": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("value")], "type": String("target_schema.filter")}, "type": Array [String("array"), String("null")]}, "$or": Object {"items": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("value")], "type": String("target_schema.filter")}, "type": Array [String("array"), String("null")]}, "value": Object {"type": Array [String("number.condition"), String("null")]}}, "type": String("filter")}}, "sensitive": Bool(false), "source": String(""), "type": String(""), "variations": Array [String("target_schema")]}}}, "type": String("drop")}
|
||||||
|
right: Object {"response": Object {"enums": Object {}, "puncs": Object {}, "relations": Object {"fk_test_target": Object {"constraint": String("fk_test_target"), "destination_columns": Array [String("id")], "destination_type": String("target_schema"), "id": String("11111111-1111-1111-1111-111111111111"), "prefix": String("target"), "source_columns": Array [String("target_id")], "source_type": String("source_schema"), "type": String("relation")}}, "types": Object {"source_schema": Object {"default_fields": Array [], "field_types": Null, "fields": Array [], "grouped_fields": Null, "hierarchy": Array [String("source_schema"), String("entity")], "historical": Bool(false), "id": String(""), "longevity": Null, "lookup_fields": Array [], "module": String(""), "name": String("source_schema"), "notify": Bool(false), "null_fields": Array [], "ownable": Bool(false), "relationship": Bool(false), "schemas": Object {"source_schema": Object {"compiledEdges": Object {"target": Object {"constraint": String("fk_test_target"), "forward": Bool(true)}}, "compiledPropertyNames": Array [String("name"), String("target"), String("type")], "properties": Object {"name": Object {"type": String("string")}, "target": Object {"compiledPropertyNames": Array [String("value")], "type": String("target_schema")}, "type": Object {"type": String("string")}}, "required": Array [String("name")], "type": String("object")}, "source_schema.filter": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("name"), String("target"), String("type")], "properties": Object {"$and": Object {"items": Object {"type": String("source_schema.filter")}, "type": Array [String("array"), String("null")]}, "$or": Object {"items": Object {"type": String("source_schema.filter")}, "type": Array [String("array"), String("null")]}, "name": Object {"type": Array [String("string.condition"), String("null")]}, "target": Object {"type": Array [String("target_schema.filter"), String("null")]}, "type": Object {"type": Array [String("string.condition"), String("null")]}}, "type": String("filter")}}, "sensitive": Bool(false), "source": String(""), "type": String(""), "variations": Array [String("source_schema")]}, "target_schema": Object {"default_fields": Array [], "field_types": Null, "fields": Array [], "grouped_fields": Null, "hierarchy": Array [String("target_schema"), String("entity")], "historical": Bool(false), "id": String(""), "longevity": Null, "lookup_fields": Array [], "module": String(""), "name": String("target_schema"), "notify": Bool(false), "null_fields": Array [], "ownable": Bool(false), "relationship": Bool(false), "schemas": Object {"target_schema": Object {"compiledPropertyNames": Array [String("value")], "properties": Object {"value": Object {"type": String("number")}}, "type": String("object")}, "target_schema.filter": Object {"compiledPropertyNames": Array [String("$and"), String("$or"), String("value")], "properties": Object {"$and": Object {"items": Object {"type": String("target_schema.filter")}, "type": Array [String("array"), String("null")]}, "$or": Object {"items": Object {"type": String("target_schema.filter")}, "type": Array [String("array"), String("null")]}, "value": Object {"type": Array [String("number.condition"), String("null")]}}, "type": String("filter")}}, "sensitive": Bool(false), "source": String(""), "type": String(""), "variations": Array [String("target_schema")]}}}, "type": String("drop")}
|
||||||
|
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||||
|
|
||||||
|
|
||||||
|
failures:
|
||||||
|
tests::test_library_api
|
||||||
|
|
||||||
|
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1357 filtered out; finished in 0.00s
|
||||||
|
|
||||||
|
error: test failed, to rerun pass `--lib`
|
||||||
55
scripts/migrate_legacy_schemas.py
Normal file
55
scripts/migrate_legacy_schemas.py
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
import glob
|
||||||
|
|
||||||
|
fixtures_dir = 'fixtures'
|
||||||
|
for filepath in glob.glob(os.path.join(fixtures_dir, '*.json')):
|
||||||
|
try:
|
||||||
|
with open(filepath, 'r') as f:
|
||||||
|
data = json.load(f)
|
||||||
|
except Exception as e:
|
||||||
|
continue
|
||||||
|
|
||||||
|
changed = False
|
||||||
|
for suite in data:
|
||||||
|
db = suite.get("database")
|
||||||
|
if not db or "schemas" not in db:
|
||||||
|
continue
|
||||||
|
|
||||||
|
legacy_schemas = db["schemas"]
|
||||||
|
# Make sure types array is ready
|
||||||
|
if "types" not in db:
|
||||||
|
db["types"] = []
|
||||||
|
|
||||||
|
# Push schemas into types
|
||||||
|
for schema_id, schema_def in legacy_schemas.items():
|
||||||
|
base_name = schema_id.split('.')[-1]
|
||||||
|
|
||||||
|
# Find an existing type with base_name first
|
||||||
|
found = False
|
||||||
|
for t in db["types"]:
|
||||||
|
if t.get("name") == base_name:
|
||||||
|
if "schemas" not in t:
|
||||||
|
t["schemas"] = {}
|
||||||
|
t["schemas"][schema_id] = schema_def
|
||||||
|
found = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if not found:
|
||||||
|
db["types"].append({
|
||||||
|
"name": base_name,
|
||||||
|
"variations": [base_name], # Optional placeholder, shouldn't break anything
|
||||||
|
"hierarchy": [base_name, "entity"],
|
||||||
|
"schemas": {
|
||||||
|
schema_id: schema_def
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
# Clean up legacy global map
|
||||||
|
del db["schemas"]
|
||||||
|
changed = True
|
||||||
|
|
||||||
|
if changed:
|
||||||
|
with open(filepath, 'w') as f:
|
||||||
|
json.dump(data, f, indent=2)
|
||||||
|
print("Migrated legacy schemas to types in", filepath)
|
||||||
54
scripts/migrate_properly.py
Normal file
54
scripts/migrate_properly.py
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
import glob
|
||||||
|
|
||||||
|
fixtures_dir = 'fixtures'
|
||||||
|
for filepath in glob.glob(os.path.join(fixtures_dir, '*.json')):
|
||||||
|
try:
|
||||||
|
with open(filepath, 'r') as f:
|
||||||
|
data = json.load(f)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Failed to load {filepath}: {e}")
|
||||||
|
continue
|
||||||
|
|
||||||
|
changed = False
|
||||||
|
for suite in data:
|
||||||
|
db = suite.get("database")
|
||||||
|
if not db or "schemas" not in db:
|
||||||
|
continue
|
||||||
|
|
||||||
|
legacy_schemas = db["schemas"]
|
||||||
|
# Make sure types array is ready
|
||||||
|
if "types" not in db:
|
||||||
|
db["types"] = []
|
||||||
|
|
||||||
|
# Push schemas into types
|
||||||
|
for schema_id, schema_def in legacy_schemas.items():
|
||||||
|
base_name = schema_id.split('.')[-1]
|
||||||
|
|
||||||
|
# Find an existing type with base_name first
|
||||||
|
found = False
|
||||||
|
for t in db["types"]:
|
||||||
|
if t.get("name") == base_name:
|
||||||
|
if "schemas" not in t:
|
||||||
|
t["schemas"] = {}
|
||||||
|
t["schemas"][schema_id] = schema_def
|
||||||
|
found = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if not found:
|
||||||
|
db["types"].append({
|
||||||
|
"name": base_name,
|
||||||
|
"schemas": {
|
||||||
|
schema_id: schema_def
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
# Clean up legacy global map
|
||||||
|
del db["schemas"]
|
||||||
|
changed = True
|
||||||
|
|
||||||
|
if changed:
|
||||||
|
with open(filepath, 'w') as f:
|
||||||
|
json.dump(data, f, indent=2)
|
||||||
|
print("Migrated legacy schemas to types properly in", filepath)
|
||||||
41
scripts/revert_puncs_to_types.js
Normal file
41
scripts/revert_puncs_to_types.js
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
function updateFile(filePath) {
|
||||||
|
let content = fs.readFileSync(filePath, 'utf8');
|
||||||
|
let data;
|
||||||
|
try {
|
||||||
|
data = JSON.parse(content);
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Failed to parse " + filePath, e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let changed = false;
|
||||||
|
for (let suite of data) {
|
||||||
|
if (suite.database && suite.database.puncs && suite.database.puncs.length > 0) {
|
||||||
|
if (!suite.database.types) suite.database.types = [];
|
||||||
|
for (let punc of suite.database.puncs) {
|
||||||
|
// Determine if we should push it to types.
|
||||||
|
// Basically all of them should go to types except maybe if they are explicitly being tested as Puncs?
|
||||||
|
// But the tests construct Queryer and Merger using these ids, which query the Type Realm.
|
||||||
|
suite.database.types.push(punc);
|
||||||
|
}
|
||||||
|
delete suite.database.puncs;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
fs.writeFileSync(filePath, JSON.stringify(data, null, 2));
|
||||||
|
console.log("Reverted puncs to types in " + filePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let fixturesDir = 'fixtures';
|
||||||
|
let files = fs.readdirSync(fixturesDir);
|
||||||
|
for (let file of files) {
|
||||||
|
if (file.endsWith('.json')) {
|
||||||
|
updateFile(path.join(fixturesDir, file));
|
||||||
|
}
|
||||||
|
}
|
||||||
29
scripts/revert_puncs_to_types.py
Normal file
29
scripts/revert_puncs_to_types.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
import glob
|
||||||
|
|
||||||
|
fixtures_dir = 'fixtures'
|
||||||
|
for filepath in glob.glob(os.path.join(fixtures_dir, '*.json')):
|
||||||
|
with open(filepath, 'r') as f:
|
||||||
|
try:
|
||||||
|
data = json.load(f)
|
||||||
|
except Exception as e:
|
||||||
|
print("Failed to parse", filepath, e)
|
||||||
|
continue
|
||||||
|
|
||||||
|
changed = False
|
||||||
|
for suite in data:
|
||||||
|
db = suite.get("database", {})
|
||||||
|
puncs = db.get("puncs", [])
|
||||||
|
if puncs:
|
||||||
|
if "types" not in db:
|
||||||
|
db["types"] = []
|
||||||
|
for punc in puncs:
|
||||||
|
db["types"].append(punc)
|
||||||
|
del db["puncs"]
|
||||||
|
changed = True
|
||||||
|
|
||||||
|
if changed:
|
||||||
|
with open(filepath, 'w') as f:
|
||||||
|
json.dump(data, f, indent=2)
|
||||||
|
print("Reverted puncs to types in", filepath)
|
||||||
43
scripts/update_fixtures.js
Normal file
43
scripts/update_fixtures.js
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
function updateFile(filePath) {
|
||||||
|
let content = fs.readFileSync(filePath, 'utf8');
|
||||||
|
let data;
|
||||||
|
try {
|
||||||
|
data = JSON.parse(content);
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Failed to parse " + filePath, e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let changed = false;
|
||||||
|
for (let suite of data) {
|
||||||
|
if (suite.database && suite.database.schemas) {
|
||||||
|
if (!suite.database.puncs) suite.database.puncs = [];
|
||||||
|
for (let id of Object.keys(suite.database.schemas)) {
|
||||||
|
let schema = suite.database.schemas[id];
|
||||||
|
let puncType = {
|
||||||
|
name: id,
|
||||||
|
schemas: { [id]: schema }
|
||||||
|
};
|
||||||
|
suite.database.puncs.push(puncType);
|
||||||
|
}
|
||||||
|
delete suite.database.schemas;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
fs.writeFileSync(filePath, JSON.stringify(data, null, 2));
|
||||||
|
console.log("Updated " + filePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let fixturesDir = 'fixtures';
|
||||||
|
let files = fs.readdirSync(fixturesDir);
|
||||||
|
for (let file of files) {
|
||||||
|
if (file.endsWith('.json')) {
|
||||||
|
updateFile(path.join(fixturesDir, file));
|
||||||
|
}
|
||||||
|
}
|
||||||
33
scripts/update_fixtures.py
Normal file
33
scripts/update_fixtures.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
|
fixtures_dir = 'fixtures'
|
||||||
|
|
||||||
|
for filename in os.listdir(fixtures_dir):
|
||||||
|
if not filename.endswith('.json'):
|
||||||
|
continue
|
||||||
|
filepath = os.path.join(fixtures_dir, filename)
|
||||||
|
with open(filepath, 'r') as f:
|
||||||
|
try:
|
||||||
|
data = json.load(f)
|
||||||
|
except json.JSONDecodeError:
|
||||||
|
print("Failed to parse", filepath)
|
||||||
|
continue
|
||||||
|
changed = False
|
||||||
|
for suite in data:
|
||||||
|
db = suite.get('database', {})
|
||||||
|
if 'schemas' in db:
|
||||||
|
if 'types' not in db:
|
||||||
|
db['types'] = []
|
||||||
|
for id_str, schema in db['schemas'].items():
|
||||||
|
target_type = {
|
||||||
|
'name': id_str,
|
||||||
|
'schemas': { id_str: schema }
|
||||||
|
}
|
||||||
|
db['types'].append(target_type)
|
||||||
|
del db['schemas']
|
||||||
|
changed = True
|
||||||
|
if changed:
|
||||||
|
with open(filepath, 'w') as f:
|
||||||
|
json.dump(data, f, indent=2)
|
||||||
|
print("Updated", filepath)
|
||||||
@ -1,6 +1,6 @@
|
|||||||
|
use crate::database::Database;
|
||||||
use crate::database::object::{SchemaObject, SchemaTypeOrArray};
|
use crate::database::object::{SchemaObject, SchemaTypeOrArray};
|
||||||
use crate::database::schema::Schema;
|
use crate::database::schema::Schema;
|
||||||
use crate::database::Database;
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ impl Schema {
|
|||||||
pub fn compile_filter(
|
pub fn compile_filter(
|
||||||
&self,
|
&self,
|
||||||
_db: &Database,
|
_db: &Database,
|
||||||
_root_id: &str,
|
root_id: &str,
|
||||||
_errors: &mut Vec<crate::drop::Error>,
|
_errors: &mut Vec<crate::drop::Error>,
|
||||||
) -> Option<Schema> {
|
) -> Option<Schema> {
|
||||||
if let Some(props) = self.obj.compiled_properties.get() {
|
if let Some(props) = self.obj.compiled_properties.get() {
|
||||||
@ -20,16 +20,68 @@ impl Schema {
|
|||||||
let mut child_obj = SchemaObject::default();
|
let mut child_obj = SchemaObject::default();
|
||||||
child_obj.type_ = Some(SchemaTypeOrArray::Multiple(filter_type));
|
child_obj.type_ = Some(SchemaTypeOrArray::Multiple(filter_type));
|
||||||
|
|
||||||
filter_props.insert(key.clone(), Arc::new(Schema { obj: child_obj, always_fail: false }));
|
filter_props.insert(
|
||||||
|
key.clone(),
|
||||||
|
Arc::new(Schema {
|
||||||
|
obj: child_obj,
|
||||||
|
always_fail: false,
|
||||||
|
}),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !filter_props.is_empty() {
|
if !filter_props.is_empty() {
|
||||||
|
let root_filter_type = format!("{}.filter", root_id);
|
||||||
|
|
||||||
|
let mut and_obj = SchemaObject::default();
|
||||||
|
and_obj.type_ = Some(SchemaTypeOrArray::Multiple(vec![
|
||||||
|
"array".to_string(),
|
||||||
|
"null".to_string(),
|
||||||
|
]));
|
||||||
|
and_obj.items = Some(Arc::new(Schema {
|
||||||
|
obj: SchemaObject {
|
||||||
|
type_: Some(SchemaTypeOrArray::Single(root_filter_type.clone())),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
always_fail: false,
|
||||||
|
}));
|
||||||
|
filter_props.insert(
|
||||||
|
"$and".to_string(),
|
||||||
|
Arc::new(Schema {
|
||||||
|
obj: and_obj,
|
||||||
|
always_fail: false,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
let mut or_obj = SchemaObject::default();
|
||||||
|
or_obj.type_ = Some(SchemaTypeOrArray::Multiple(vec![
|
||||||
|
"array".to_string(),
|
||||||
|
"null".to_string(),
|
||||||
|
]));
|
||||||
|
or_obj.items = Some(Arc::new(Schema {
|
||||||
|
obj: SchemaObject {
|
||||||
|
type_: Some(SchemaTypeOrArray::Single(root_filter_type.clone())),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
always_fail: false,
|
||||||
|
}));
|
||||||
|
filter_props.insert(
|
||||||
|
"$or".to_string(),
|
||||||
|
Arc::new(Schema {
|
||||||
|
obj: or_obj,
|
||||||
|
always_fail: false,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
let mut wrapper_obj = SchemaObject::default();
|
let mut wrapper_obj = SchemaObject::default();
|
||||||
wrapper_obj.type_ = Some(SchemaTypeOrArray::Single("object".to_string()));
|
// Conceptually link this directly into the STI lineage of the base `filter` object
|
||||||
|
wrapper_obj.type_ = Some(SchemaTypeOrArray::Single("filter".to_string()));
|
||||||
wrapper_obj.properties = Some(filter_props);
|
wrapper_obj.properties = Some(filter_props);
|
||||||
|
|
||||||
return Some(Schema { obj: wrapper_obj, always_fail: false });
|
return Some(Schema {
|
||||||
|
obj: wrapper_obj,
|
||||||
|
always_fail: false,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
@ -1,6 +1,6 @@
|
|||||||
pub mod collection;
|
pub mod collection;
|
||||||
pub mod edges;
|
pub mod edges;
|
||||||
pub mod filters;
|
pub mod filter;
|
||||||
pub mod polymorphism;
|
pub mod polymorphism;
|
||||||
|
|
||||||
use crate::database::schema::Schema;
|
use crate::database::schema::Schema;
|
||||||
@ -52,7 +52,7 @@ impl Schema {
|
|||||||
// 1. Resolve INHERITANCE dependencies first
|
// 1. Resolve INHERITANCE dependencies first
|
||||||
if let Some(crate::database::object::SchemaTypeOrArray::Single(t)) = &self.obj.type_ {
|
if let Some(crate::database::object::SchemaTypeOrArray::Single(t)) = &self.obj.type_ {
|
||||||
if !crate::database::object::is_primitive_type(t) {
|
if !crate::database::object::is_primitive_type(t) {
|
||||||
if let Some(parent) = db.schemas.get(t) {
|
if let Some(parent) = db.get_scoped_schema(crate::database::realm::SchemaRealm::Type, t) {
|
||||||
parent.as_ref().compile(db, t, t.clone(), errors);
|
parent.as_ref().compile(db, t, t.clone(), errors);
|
||||||
if let Some(p_props) = parent.obj.compiled_properties.get() {
|
if let Some(p_props) = parent.obj.compiled_properties.get() {
|
||||||
props.extend(p_props.clone());
|
props.extend(p_props.clone());
|
||||||
@ -86,7 +86,7 @@ impl Schema {
|
|||||||
|
|
||||||
for t in types {
|
for t in types {
|
||||||
if !crate::database::object::is_primitive_type(t) {
|
if !crate::database::object::is_primitive_type(t) {
|
||||||
if let Some(parent) = db.schemas.get(t) {
|
if let Some(parent) = db.get_scoped_schema(crate::database::realm::SchemaRealm::Type, t) {
|
||||||
parent.as_ref().compile(db, t, t.clone(), errors);
|
parent.as_ref().compile(db, t, t.clone(), errors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ impl Schema {
|
|||||||
format!("{}.{}", family_prefix, var)
|
format!("{}.{}", family_prefix, var)
|
||||||
};
|
};
|
||||||
|
|
||||||
if db.schemas.contains_key(&target_id) {
|
if db.get_scoped_schema(crate::database::realm::SchemaRealm::Type, &target_id).is_some() {
|
||||||
options.insert(var.to_string(), (None, Some(target_id)));
|
options.insert(var.to_string(), (None, Some(target_id)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,12 +6,11 @@ pub mod formats;
|
|||||||
pub mod object;
|
pub mod object;
|
||||||
pub mod page;
|
pub mod page;
|
||||||
pub mod punc;
|
pub mod punc;
|
||||||
|
pub mod realm;
|
||||||
pub mod relation;
|
pub mod relation;
|
||||||
pub mod schema;
|
pub mod schema;
|
||||||
pub mod r#type;
|
pub mod r#type;
|
||||||
|
|
||||||
// External mock exports inside the executor sub-folder
|
|
||||||
|
|
||||||
use r#enum::Enum;
|
use r#enum::Enum;
|
||||||
use executors::DatabaseExecutor;
|
use executors::DatabaseExecutor;
|
||||||
|
|
||||||
@ -22,6 +21,7 @@ use executors::pgrx::SpiExecutor;
|
|||||||
use executors::mock::MockExecutor;
|
use executors::mock::MockExecutor;
|
||||||
|
|
||||||
use punc::Punc;
|
use punc::Punc;
|
||||||
|
use realm::SchemaRealm;
|
||||||
use relation::Relation;
|
use relation::Relation;
|
||||||
use schema::Schema;
|
use schema::Schema;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
@ -36,8 +36,6 @@ pub struct Database {
|
|||||||
pub puncs: HashMap<String, Punc>,
|
pub puncs: HashMap<String, Punc>,
|
||||||
pub relations: HashMap<String, Relation>,
|
pub relations: HashMap<String, Relation>,
|
||||||
#[serde(skip)]
|
#[serde(skip)]
|
||||||
pub schemas: HashMap<String, Arc<Schema>>,
|
|
||||||
#[serde(skip)]
|
|
||||||
pub executor: Box<dyn DatabaseExecutor + Send + Sync>,
|
pub executor: Box<dyn DatabaseExecutor + Send + Sync>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +46,6 @@ impl Database {
|
|||||||
types: HashMap::new(),
|
types: HashMap::new(),
|
||||||
relations: HashMap::new(),
|
relations: HashMap::new(),
|
||||||
puncs: HashMap::new(),
|
puncs: HashMap::new(),
|
||||||
schemas: HashMap::new(),
|
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
executor: Box::new(SpiExecutor::new()),
|
executor: Box::new(SpiExecutor::new()),
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@ -157,26 +154,6 @@ impl Database {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(map) = val.get("schemas").and_then(|v| v.as_object()) {
|
|
||||||
for (key, item) in map.iter() {
|
|
||||||
match serde_json::from_value::<Schema>(item.clone()) {
|
|
||||||
Ok(schema) => {
|
|
||||||
db.schemas.insert(key.clone(), Arc::new(schema));
|
|
||||||
}
|
|
||||||
Err(e) => {
|
|
||||||
errors.push(crate::drop::Error {
|
|
||||||
code: "DATABASE_SCHEMA_PARSE_FAILED".to_string(),
|
|
||||||
message: format!("Failed to parse database schema key '{}': {}", key, e),
|
|
||||||
details: crate::drop::ErrorDetails {
|
|
||||||
context: Some(serde_json::json!(key)),
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
db.compile(&mut errors);
|
db.compile(&mut errors);
|
||||||
let drop = if errors.is_empty() {
|
let drop = if errors.is_empty() {
|
||||||
crate::drop::Drop::success()
|
crate::drop::Drop::success()
|
||||||
@ -213,30 +190,26 @@ impl Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn compile(&mut self, errors: &mut Vec<crate::drop::Error>) {
|
pub fn compile(&mut self, errors: &mut Vec<crate::drop::Error>) {
|
||||||
// Collect existing schemas patched in the databse
|
|
||||||
let mut harvested = Vec::new();
|
|
||||||
for (id, schema_arc) in &self.schemas {
|
|
||||||
crate::database::schema::Schema::collect_schemas(
|
|
||||||
schema_arc,
|
|
||||||
id,
|
|
||||||
id.clone(),
|
|
||||||
&mut harvested,
|
|
||||||
errors,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
for (id, schema_arc) in harvested {
|
|
||||||
self.schemas.insert(id, schema_arc);
|
|
||||||
}
|
|
||||||
|
|
||||||
self.collect_schemas(errors);
|
self.collect_schemas(errors);
|
||||||
|
|
||||||
// Mathematically evaluate all property inheritances, formats, schemas, and foreign key edges topographically over OnceLocks
|
// Formally evaluate properties with strict 3-pass Ordered Graph execution natively
|
||||||
for (id, schema_arc) in &self.schemas {
|
for (_, enum_def) in &self.enums {
|
||||||
// First compile pass initializes exact structural root_id mapping to resolve DB constraints
|
for (schema_id, schema_arc) in &enum_def.schemas {
|
||||||
let root_id = id.split('/').next().unwrap_or(id);
|
let root_id = schema_id.split('/').next().unwrap_or(schema_id);
|
||||||
schema_arc
|
schema_arc.as_ref().compile(self, root_id, schema_id.clone(), errors);
|
||||||
.as_ref()
|
}
|
||||||
.compile(self, root_id, id.clone(), errors);
|
}
|
||||||
|
for (_, type_def) in &self.types {
|
||||||
|
for (schema_id, schema_arc) in &type_def.schemas {
|
||||||
|
let root_id = schema_id.split('/').next().unwrap_or(schema_id);
|
||||||
|
schema_arc.as_ref().compile(self, root_id, schema_id.clone(), errors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (_, punc_def) in &self.puncs {
|
||||||
|
for (schema_id, schema_arc) in &punc_def.schemas {
|
||||||
|
let root_id = schema_id.split('/').next().unwrap_or(schema_id);
|
||||||
|
schema_arc.as_ref().compile(self, root_id, schema_id.clone(), errors);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Phase 2: Synthesize Composed Filter References
|
// Phase 2: Synthesize Composed Filter References
|
||||||
@ -260,16 +233,15 @@ impl Database {
|
|||||||
|
|
||||||
let mut filter_ids = Vec::new();
|
let mut filter_ids = Vec::new();
|
||||||
for (type_name, id, filter_arc) in filter_schemas {
|
for (type_name, id, filter_arc) in filter_schemas {
|
||||||
filter_ids.push(id.clone());
|
filter_ids.push((type_name.clone(), id.clone()));
|
||||||
self.schemas.insert(id.clone(), filter_arc.clone());
|
|
||||||
if let Some(t) = self.types.get_mut(&type_name) {
|
if let Some(t) = self.types.get_mut(&type_name) {
|
||||||
t.schemas.insert(id, filter_arc);
|
t.schemas.insert(id, filter_arc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now actively compile the newly injected filters to lock all nested compose references natively
|
// Now actively compile the newly injected filters to lock all nested compose references natively
|
||||||
for id in filter_ids {
|
for (type_name, id) in filter_ids {
|
||||||
if let Some(filter_arc) = self.schemas.get(&id).cloned() {
|
if let Some(filter_arc) = self.types.get(&type_name).and_then(|t| t.schemas.get(&id)).cloned() {
|
||||||
let root_id = id.split('/').next().unwrap_or(&id);
|
let root_id = id.split('/').next().unwrap_or(&id);
|
||||||
filter_arc
|
filter_arc
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@ -282,13 +254,11 @@ impl Database {
|
|||||||
let mut type_insert = Vec::new();
|
let mut type_insert = Vec::new();
|
||||||
let mut punc_insert = Vec::new();
|
let mut punc_insert = Vec::new();
|
||||||
let mut enum_insert = Vec::new();
|
let mut enum_insert = Vec::new();
|
||||||
let mut global_insert = Vec::new();
|
|
||||||
|
|
||||||
// Pass 1: Extract all Schemas structurally off top level definitions into the master registry.
|
// Pass 1: Extract all Schemas structurally off top level definitions into the master registry.
|
||||||
// Validate every node recursively via string filters natively!
|
// Validate every node recursively via string filters natively!
|
||||||
for (type_name, type_def) in &self.types {
|
for (type_name, type_def) in &self.types {
|
||||||
for (id, schema_arc) in &type_def.schemas {
|
for (id, schema_arc) in &type_def.schemas {
|
||||||
global_insert.push((id.clone(), Arc::clone(schema_arc)));
|
|
||||||
let mut local_insert = Vec::new();
|
let mut local_insert = Vec::new();
|
||||||
crate::database::schema::Schema::collect_schemas(
|
crate::database::schema::Schema::collect_schemas(
|
||||||
schema_arc,
|
schema_arc,
|
||||||
@ -299,14 +269,12 @@ impl Database {
|
|||||||
);
|
);
|
||||||
for entry in &local_insert {
|
for entry in &local_insert {
|
||||||
type_insert.push((type_name.clone(), entry.0.clone(), Arc::clone(&entry.1)));
|
type_insert.push((type_name.clone(), entry.0.clone(), Arc::clone(&entry.1)));
|
||||||
global_insert.push((entry.0.clone(), Arc::clone(&entry.1)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (punc_name, punc_def) in &self.puncs {
|
for (punc_name, punc_def) in &self.puncs {
|
||||||
for (id, schema_arc) in &punc_def.schemas {
|
for (id, schema_arc) in &punc_def.schemas {
|
||||||
global_insert.push((id.clone(), Arc::clone(schema_arc)));
|
|
||||||
let mut local_insert = Vec::new();
|
let mut local_insert = Vec::new();
|
||||||
crate::database::schema::Schema::collect_schemas(
|
crate::database::schema::Schema::collect_schemas(
|
||||||
schema_arc,
|
schema_arc,
|
||||||
@ -317,14 +285,12 @@ impl Database {
|
|||||||
);
|
);
|
||||||
for entry in &local_insert {
|
for entry in &local_insert {
|
||||||
punc_insert.push((punc_name.clone(), entry.0.clone(), Arc::clone(&entry.1)));
|
punc_insert.push((punc_name.clone(), entry.0.clone(), Arc::clone(&entry.1)));
|
||||||
global_insert.push((entry.0.clone(), Arc::clone(&entry.1)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (enum_name, enum_def) in &self.enums {
|
for (enum_name, enum_def) in &self.enums {
|
||||||
for (id, schema_arc) in &enum_def.schemas {
|
for (id, schema_arc) in &enum_def.schemas {
|
||||||
global_insert.push((id.clone(), Arc::clone(schema_arc)));
|
|
||||||
let mut local_insert = Vec::new();
|
let mut local_insert = Vec::new();
|
||||||
crate::database::schema::Schema::collect_schemas(
|
crate::database::schema::Schema::collect_schemas(
|
||||||
schema_arc,
|
schema_arc,
|
||||||
@ -335,16 +301,10 @@ impl Database {
|
|||||||
);
|
);
|
||||||
for entry in &local_insert {
|
for entry in &local_insert {
|
||||||
enum_insert.push((enum_name.clone(), entry.0.clone(), Arc::clone(&entry.1)));
|
enum_insert.push((enum_name.clone(), entry.0.clone(), Arc::clone(&entry.1)));
|
||||||
global_insert.push((entry.0.clone(), Arc::clone(&entry.1)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply global inserts
|
|
||||||
for (id, schema_arc) in global_insert {
|
|
||||||
self.schemas.insert(id, schema_arc);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply local scopes
|
// Apply local scopes
|
||||||
for (origin_name, id, schema_arc) in type_insert {
|
for (origin_name, id, schema_arc) in type_insert {
|
||||||
if let Some(t) = self.types.get_mut(&origin_name) {
|
if let Some(t) = self.types.get_mut(&origin_name) {
|
||||||
@ -362,6 +322,40 @@ impl Database {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_scoped_schema(&self, realm: SchemaRealm, schema_id: &str) -> Option<Arc<Schema>> {
|
||||||
|
// Punc Realm natively maps mathematically to `.request` and `.response` shapes
|
||||||
|
if realm == SchemaRealm::Punc {
|
||||||
|
if schema_id.ends_with(".request") || schema_id.ends_with(".response") {
|
||||||
|
let punc_name = schema_id
|
||||||
|
.trim_end_matches(".request")
|
||||||
|
.trim_end_matches(".response");
|
||||||
|
return self.puncs.get(punc_name).and_then(|p| p.schemas.get(schema_id).cloned());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let clean_id = schema_id.trim_end_matches(".filter");
|
||||||
|
let root_id = clean_id.split('/').next().unwrap_or(clean_id);
|
||||||
|
let base_name = root_id.split('.').next_back().unwrap_or(root_id);
|
||||||
|
|
||||||
|
// Puncs and Types can lookup Table boundaries
|
||||||
|
if realm == SchemaRealm::Type || realm == SchemaRealm::Punc {
|
||||||
|
if let Some(type_def) = self.types.get(base_name) {
|
||||||
|
if let Some(schema) = type_def.schemas.get(schema_id) {
|
||||||
|
return Some(schema.clone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// All realms can intrinsically look up enumerations
|
||||||
|
if let Some(enum_def) = self.enums.get(base_name) {
|
||||||
|
if let Some(schema) = enum_def.schemas.get(schema_id) {
|
||||||
|
return Some(schema.clone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
/// Inspects the Postgres pg_constraint relations catalog to securely identify
|
/// Inspects the Postgres pg_constraint relations catalog to securely identify
|
||||||
/// the precise Foreign Key connecting a parent and child hierarchy path.
|
/// the precise Foreign Key connecting a parent and child hierarchy path.
|
||||||
|
|||||||
@ -15,6 +15,7 @@ pub struct Punc {
|
|||||||
pub public: bool,
|
pub public: bool,
|
||||||
pub form: bool,
|
pub form: bool,
|
||||||
pub get: Option<String>,
|
pub get: Option<String>,
|
||||||
|
pub save: Option<String>,
|
||||||
pub page: Option<Page>,
|
pub page: Option<Page>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub schemas: std::collections::BTreeMap<String, Arc<Schema>>,
|
pub schemas: std::collections::BTreeMap<String, Arc<Schema>>,
|
||||||
|
|||||||
6
src/database/realm.rs
Normal file
6
src/database/realm.rs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
|
pub enum SchemaRealm {
|
||||||
|
Enum,
|
||||||
|
Type,
|
||||||
|
Punc,
|
||||||
|
}
|
||||||
@ -3,6 +3,8 @@ use serde::{Deserialize, Serialize};
|
|||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub struct Relation {
|
pub struct Relation {
|
||||||
|
pub id: String,
|
||||||
|
pub r#type: String,
|
||||||
pub constraint: String,
|
pub constraint: String,
|
||||||
pub source_type: String,
|
pub source_type: String,
|
||||||
pub source_columns: Vec<String>,
|
pub source_columns: Vec<String>,
|
||||||
|
|||||||
@ -72,7 +72,7 @@ pub fn jspg_merge(schema_id: &str, data: JsonB) -> JsonB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(not(test), pg_extern)]
|
#[cfg_attr(not(test), pg_extern)]
|
||||||
pub fn jspg_query(schema_id: &str, filters: Option<JsonB>) -> JsonB {
|
pub fn jspg_query(schema_id: &str, filter: Option<JsonB>) -> JsonB {
|
||||||
let engine_opt = {
|
let engine_opt = {
|
||||||
let lock = GLOBAL_JSPG.read().unwrap();
|
let lock = GLOBAL_JSPG.read().unwrap();
|
||||||
lock.clone()
|
lock.clone()
|
||||||
@ -82,7 +82,7 @@ pub fn jspg_query(schema_id: &str, filters: Option<JsonB>) -> JsonB {
|
|||||||
Some(engine) => {
|
Some(engine) => {
|
||||||
let drop = engine
|
let drop = engine
|
||||||
.queryer
|
.queryer
|
||||||
.query(schema_id, filters.as_ref().map(|f| &f.0));
|
.query(schema_id, filter.as_ref().map(|f| &f.0));
|
||||||
JsonB(serde_json::to_value(drop).unwrap())
|
JsonB(serde_json::to_value(drop).unwrap())
|
||||||
}
|
}
|
||||||
None => jspg_failure(),
|
None => jspg_failure(),
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
pub mod cache;
|
pub mod cache;
|
||||||
|
|
||||||
use crate::database::Database;
|
use crate::database::Database;
|
||||||
|
use crate::database::realm::SchemaRealm;
|
||||||
use crate::database::r#type::Type;
|
use crate::database::r#type::Type;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
@ -24,8 +25,8 @@ impl Merger {
|
|||||||
pub fn merge(&self, schema_id: &str, data: Value) -> crate::drop::Drop {
|
pub fn merge(&self, schema_id: &str, data: Value) -> crate::drop::Drop {
|
||||||
let mut notifications_queue = Vec::new();
|
let mut notifications_queue = Vec::new();
|
||||||
|
|
||||||
let target_schema = match self.db.schemas.get(schema_id) {
|
let target_schema = match self.db.get_scoped_schema(SchemaRealm::Type, schema_id) {
|
||||||
Some(s) => Arc::clone(s),
|
Some(s) => Arc::clone(&s),
|
||||||
None => {
|
None => {
|
||||||
return crate::drop::Drop::with_errors(vec![crate::drop::Error {
|
return crate::drop::Drop::with_errors(vec![crate::drop::Error {
|
||||||
code: "MERGE_FAILED".to_string(),
|
code: "MERGE_FAILED".to_string(),
|
||||||
@ -144,30 +145,49 @@ impl Merger {
|
|||||||
if let Some(v) = val {
|
if let Some(v) = val {
|
||||||
if let Some((idx_opt, target_id_opt)) = options.get(v) {
|
if let Some((idx_opt, target_id_opt)) = options.get(v) {
|
||||||
if let Some(target_id) = target_id_opt {
|
if let Some(target_id) = target_id_opt {
|
||||||
if let Some(target_schema) = self.db.schemas.get(target_id) {
|
if let Some(target_schema) =
|
||||||
schema = Arc::clone(target_schema);
|
self.db.get_scoped_schema(SchemaRealm::Type, target_id)
|
||||||
|
{
|
||||||
|
schema = target_schema.clone();
|
||||||
} else {
|
} else {
|
||||||
return Err(format!("Polymorphic mapped target '{}' not found in database registry", target_id));
|
return Err(format!(
|
||||||
|
"Polymorphic mapped target '{}' not found in database registry",
|
||||||
|
target_id
|
||||||
|
));
|
||||||
}
|
}
|
||||||
} else if let Some(idx) = idx_opt {
|
} else if let Some(idx) = idx_opt {
|
||||||
if let Some(target_schema) = schema.obj.one_of.as_ref().and_then(|options| options.get(*idx)) {
|
if let Some(target_schema) = schema
|
||||||
schema = Arc::clone(target_schema);
|
.obj
|
||||||
|
.one_of
|
||||||
|
.as_ref()
|
||||||
|
.and_then(|options| options.get(*idx))
|
||||||
|
{
|
||||||
|
schema = Arc::clone(target_schema);
|
||||||
} else {
|
} else {
|
||||||
return Err(format!("Polymorphic index target '{}' not found in local oneOf array", idx));
|
return Err(format!(
|
||||||
|
"Polymorphic index target '{}' not found in local oneOf array",
|
||||||
|
idx
|
||||||
|
));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Err(format!("Polymorphic mapped target has no path"));
|
return Err(format!("Polymorphic mapped target has no path"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Err(format!("Polymorphic discriminator {}='{}' matched no compiled options", disc, v));
|
return Err(format!(
|
||||||
|
"Polymorphic discriminator {}='{}' matched no compiled options",
|
||||||
|
disc, v
|
||||||
|
));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Err(format!("Polymorphic merging failed: missing required discriminator '{}'", disc));
|
return Err(format!(
|
||||||
|
"Polymorphic merging failed: missing required discriminator '{}'",
|
||||||
|
disc
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.merge_object(schema, map, notifications)
|
self.merge_object(schema, map, notifications)
|
||||||
},
|
}
|
||||||
_ => Err("Invalid merge payload: root must be an Object or Array".to_string()),
|
_ => Err("Invalid merge payload: root must be an Object or Array".to_string()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
use crate::database::Database;
|
use crate::database::Database;
|
||||||
|
use crate::database::realm::SchemaRealm;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
pub struct Compiler<'a> {
|
pub struct Compiler<'a> {
|
||||||
@ -24,13 +25,18 @@ pub struct Node<'a> {
|
|||||||
impl<'a> Compiler<'a> {
|
impl<'a> Compiler<'a> {
|
||||||
/// Compiles a JSON schema into a nested PostgreSQL query returning JSONB
|
/// Compiles a JSON schema into a nested PostgreSQL query returning JSONB
|
||||||
pub fn compile(&self, schema_id: &str, filter_keys: &[String]) -> Result<String, String> {
|
pub fn compile(&self, schema_id: &str, filter_keys: &[String]) -> Result<String, String> {
|
||||||
|
let realm = if schema_id.ends_with(".request") || schema_id.ends_with(".response") {
|
||||||
|
SchemaRealm::Punc
|
||||||
|
} else {
|
||||||
|
SchemaRealm::Type
|
||||||
|
};
|
||||||
|
|
||||||
let schema = self
|
let schema = self
|
||||||
.db
|
.db
|
||||||
.schemas
|
.get_scoped_schema(realm, schema_id)
|
||||||
.get(schema_id)
|
|
||||||
.ok_or_else(|| format!("Schema not found: {}", schema_id))?;
|
.ok_or_else(|| format!("Schema not found: {}", schema_id))?;
|
||||||
|
|
||||||
let target_schema = std::sync::Arc::clone(schema);
|
let target_schema = schema;
|
||||||
|
|
||||||
let mut compiler = Compiler {
|
let mut compiler = Compiler {
|
||||||
db: &self.db,
|
db: &self.db,
|
||||||
@ -151,9 +157,9 @@ impl<'a> Compiler<'a> {
|
|||||||
if let Some(crate::database::object::SchemaTypeOrArray::Single(t)) = &node.schema.obj.type_ {
|
if let Some(crate::database::object::SchemaTypeOrArray::Single(t)) = &node.schema.obj.type_ {
|
||||||
if !crate::database::object::is_primitive_type(t) {
|
if !crate::database::object::is_primitive_type(t) {
|
||||||
// If it's just an ad-hoc struct ref, we should resolve it
|
// If it's just an ad-hoc struct ref, we should resolve it
|
||||||
if let Some(target_schema) = self.db.schemas.get(t) {
|
if let Some(target_schema) = self.db.get_scoped_schema(SchemaRealm::Type, t) {
|
||||||
let mut ref_node = node.clone();
|
let mut ref_node = node.clone();
|
||||||
ref_node.schema = Arc::clone(target_schema);
|
ref_node.schema = target_schema.clone();
|
||||||
ref_node.schema_id = Some(t.clone());
|
ref_node.schema_id = Some(t.clone());
|
||||||
return self.compile_node(ref_node);
|
return self.compile_node(ref_node);
|
||||||
}
|
}
|
||||||
@ -306,9 +312,9 @@ impl<'a> Compiler<'a> {
|
|||||||
|
|
||||||
for (disc_val, (idx_opt, target_id_opt)) in options {
|
for (disc_val, (idx_opt, target_id_opt)) in options {
|
||||||
if let Some(target_id) = target_id_opt {
|
if let Some(target_id) = target_id_opt {
|
||||||
if let Some(target_schema) = self.db.schemas.get(target_id) {
|
if let Some(target_schema) = self.db.get_scoped_schema(SchemaRealm::Type, target_id) {
|
||||||
let mut child_node = node.clone();
|
let mut child_node = node.clone();
|
||||||
child_node.schema = Arc::clone(target_schema);
|
child_node.schema = target_schema.clone();
|
||||||
child_node.schema_id = Some(target_id.clone());
|
child_node.schema_id = Some(target_id.clone());
|
||||||
child_node.is_polymorphic_branch = true;
|
child_node.is_polymorphic_branch = true;
|
||||||
|
|
||||||
|
|||||||
@ -21,9 +21,9 @@ impl Queryer {
|
|||||||
pub fn query(
|
pub fn query(
|
||||||
&self,
|
&self,
|
||||||
schema_id: &str,
|
schema_id: &str,
|
||||||
filters: Option<&serde_json::Value>,
|
filter: Option<&serde_json::Value>,
|
||||||
) -> crate::drop::Drop {
|
) -> crate::drop::Drop {
|
||||||
let filters_map = filters.and_then(|f| f.as_object());
|
let filters_map = filter.and_then(|f| f.as_object());
|
||||||
|
|
||||||
// 1. Process filters into structured $op keys and linear values
|
// 1. Process filters into structured $op keys and linear values
|
||||||
let (filter_keys, args) = match self.parse_filter_entries(filters_map) {
|
let (filter_keys, args) = match self.parse_filter_entries(filters_map) {
|
||||||
@ -35,7 +35,7 @@ impl Queryer {
|
|||||||
details: crate::drop::ErrorDetails {
|
details: crate::drop::ErrorDetails {
|
||||||
path: None, // filters apply to the root query
|
path: None, // filters apply to the root query
|
||||||
cause: Some(msg),
|
cause: Some(msg),
|
||||||
context: filters.cloned(),
|
context: filter.cloned(),
|
||||||
schema: Some(schema_id.to_string()),
|
schema: Some(schema_id.to_string()),
|
||||||
},
|
},
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
@ -92,6 +92,8 @@ fn test_library_api() {
|
|||||||
"puncs": {},
|
"puncs": {},
|
||||||
"relations": {
|
"relations": {
|
||||||
"fk_test_target": {
|
"fk_test_target": {
|
||||||
|
"id": "11111111-1111-1111-1111-111111111111",
|
||||||
|
"type": "relation",
|
||||||
"constraint": "fk_test_target",
|
"constraint": "fk_test_target",
|
||||||
"destination_columns": ["id"],
|
"destination_columns": ["id"],
|
||||||
"destination_type": "target_schema",
|
"destination_type": "target_schema",
|
||||||
@ -138,13 +140,27 @@ fn test_library_api() {
|
|||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"source_schema.filter": {
|
"source_schema.filter": {
|
||||||
"compiledPropertyNames": ["name", "target", "type"],
|
"compiledPropertyNames": ["$and", "$or", "name", "target", "type"],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"$and": {
|
||||||
|
"type": ["array", "null"],
|
||||||
|
"items": {
|
||||||
|
"compiledPropertyNames": ["$and", "$or", "name", "target", "type"],
|
||||||
|
"type": "source_schema.filter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$or": {
|
||||||
|
"type": ["array", "null"],
|
||||||
|
"items": {
|
||||||
|
"compiledPropertyNames": ["$and", "$or", "name", "target", "type"],
|
||||||
|
"type": "source_schema.filter"
|
||||||
|
}
|
||||||
|
},
|
||||||
"name": { "type": ["string.condition", "null"] },
|
"name": { "type": ["string.condition", "null"] },
|
||||||
"target": { "type": ["target_schema.filter", "null"] },
|
"target": { "type": ["target_schema.filter", "null"] },
|
||||||
"type": { "type": ["string.condition", "null"] }
|
"type": { "type": ["string.condition", "null"] }
|
||||||
},
|
},
|
||||||
"type": "object"
|
"type": "filter"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sensitive": false,
|
"sensitive": false,
|
||||||
@ -177,11 +193,25 @@ fn test_library_api() {
|
|||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"target_schema.filter": {
|
"target_schema.filter": {
|
||||||
"compiledPropertyNames": ["value"],
|
"compiledPropertyNames": ["$and", "$or", "value"],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"$and": {
|
||||||
|
"type": ["array", "null"],
|
||||||
|
"items": {
|
||||||
|
"compiledPropertyNames": ["$and", "$or", "value"],
|
||||||
|
"type": "target_schema.filter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$or": {
|
||||||
|
"type": ["array", "null"],
|
||||||
|
"items": {
|
||||||
|
"compiledPropertyNames": ["$and", "$or", "value"],
|
||||||
|
"type": "target_schema.filter"
|
||||||
|
}
|
||||||
|
},
|
||||||
"value": { "type": ["number.condition", "null"] }
|
"value": { "type": ["number.condition", "null"] }
|
||||||
},
|
},
|
||||||
"type": "object"
|
"type": "filter"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sensitive": false,
|
"sensitive": false,
|
||||||
|
|||||||
@ -17,7 +17,7 @@ pub struct Case {
|
|||||||
|
|
||||||
// For Query
|
// For Query
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub filters: Option<serde_json::Value>,
|
pub filter: Option<serde_json::Value>,
|
||||||
|
|
||||||
// For Merge & Validate
|
// For Merge & Validate
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
@ -64,12 +64,6 @@ impl Case {
|
|||||||
let validator = Validator::new(db);
|
let validator = Validator::new(db);
|
||||||
|
|
||||||
let schema_id = &self.schema_id;
|
let schema_id = &self.schema_id;
|
||||||
if !validator.db.schemas.contains_key(schema_id) {
|
|
||||||
return Err(format!(
|
|
||||||
"Missing Schema: Cannot find schema ID '{}'",
|
|
||||||
schema_id
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
let test_data = self.data.clone().unwrap_or(Value::Null);
|
let test_data = self.data.clone().unwrap_or(Value::Null);
|
||||||
let result = validator.validate(schema_id, &test_data);
|
let result = validator.validate(schema_id, &test_data);
|
||||||
@ -122,7 +116,7 @@ impl Case {
|
|||||||
use crate::queryer::Queryer;
|
use crate::queryer::Queryer;
|
||||||
let queryer = Queryer::new(db.clone());
|
let queryer = Queryer::new(db.clone());
|
||||||
|
|
||||||
let result = queryer.query(&self.schema_id, self.filters.as_ref());
|
let result = queryer.query(&self.schema_id, self.filter.as_ref());
|
||||||
|
|
||||||
let return_val = if let Some(expect) = &self.expect {
|
let return_val = if let Some(expect) = &self.expect {
|
||||||
if let Err(e) = expect.assert_drop(&result) {
|
if let Err(e) = expect.assert_drop(&result) {
|
||||||
|
|||||||
@ -5,7 +5,16 @@ impl Expect {
|
|||||||
pub fn assert_schemas(&self, db: &Arc<crate::database::Database>) -> Result<(), String> {
|
pub fn assert_schemas(&self, db: &Arc<crate::database::Database>) -> Result<(), String> {
|
||||||
if let Some(expected_map) = &self.schemas {
|
if let Some(expected_map) = &self.schemas {
|
||||||
// Collect actual schemas and sort
|
// Collect actual schemas and sort
|
||||||
let mut actual: Vec<String> = db.schemas.keys().cloned().collect();
|
let mut actual: Vec<String> = Vec::new();
|
||||||
|
for type_def in db.types.values() {
|
||||||
|
actual.extend(type_def.schemas.keys().cloned());
|
||||||
|
}
|
||||||
|
for punc_def in db.puncs.values() {
|
||||||
|
actual.extend(punc_def.schemas.keys().cloned());
|
||||||
|
}
|
||||||
|
for enum_def in db.enums.values() {
|
||||||
|
actual.extend(enum_def.schemas.keys().cloned());
|
||||||
|
}
|
||||||
actual.sort();
|
actual.sort();
|
||||||
|
|
||||||
// Collect expected schemas and sort
|
// Collect expected schemas and sort
|
||||||
@ -26,7 +35,12 @@ impl Expect {
|
|||||||
if expected_val.is_object() && expected_val.as_object().unwrap().is_empty() {
|
if expected_val.is_object() && expected_val.as_object().unwrap().is_empty() {
|
||||||
continue; // A `{}` means we just wanted to test it was collected/promoted, skip deep match
|
continue; // A `{}` means we just wanted to test it was collected/promoted, skip deep match
|
||||||
}
|
}
|
||||||
let actual_ast = db.schemas.get(key).unwrap();
|
let schema_realm = if key.ends_with(".request") || key.ends_with(".response") {
|
||||||
|
crate::database::realm::SchemaRealm::Punc
|
||||||
|
} else {
|
||||||
|
crate::database::realm::SchemaRealm::Type
|
||||||
|
};
|
||||||
|
let actual_ast = db.get_scoped_schema(schema_realm, key).unwrap();
|
||||||
let actual_val = serde_json::to_value(actual_ast).unwrap();
|
let actual_val = serde_json::to_value(actual_ast).unwrap();
|
||||||
|
|
||||||
if actual_val != *expected_val {
|
if actual_val != *expected_val {
|
||||||
|
|||||||
@ -10,6 +10,7 @@ pub use error::ValidationError;
|
|||||||
pub use result::ValidationResult;
|
pub use result::ValidationResult;
|
||||||
|
|
||||||
use crate::database::Database;
|
use crate::database::Database;
|
||||||
|
use crate::database::realm::SchemaRealm;
|
||||||
use crate::validator::rules::util::is_integer;
|
use crate::validator::rules::util::is_integer;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
@ -23,10 +24,6 @@ impl Validator {
|
|||||||
Self { db }
|
Self { db }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_schema_ids(&self) -> Vec<String> {
|
|
||||||
self.db.schemas.keys().cloned().collect()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn check_type(t: &str, val: &Value) -> bool {
|
pub fn check_type(t: &str, val: &Value) -> bool {
|
||||||
if let Value::String(s) = val
|
if let Value::String(s) = val
|
||||||
&& s.is_empty()
|
&& s.is_empty()
|
||||||
@ -46,11 +43,17 @@ impl Validator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn validate(&self, schema_id: &str, instance: &Value) -> crate::drop::Drop {
|
pub fn validate(&self, schema_id: &str, instance: &Value) -> crate::drop::Drop {
|
||||||
if let Some(schema) = self.db.schemas.get(schema_id) {
|
let schema_opt = if schema_id.ends_with(".request") || schema_id.ends_with(".response") {
|
||||||
|
self.db.get_scoped_schema(SchemaRealm::Punc, schema_id)
|
||||||
|
} else {
|
||||||
|
self.db.get_scoped_schema(SchemaRealm::Type, schema_id)
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Some(schema) = schema_opt {
|
||||||
let ctx = ValidationContext::new(
|
let ctx = ValidationContext::new(
|
||||||
&self.db,
|
&self.db,
|
||||||
schema,
|
&schema,
|
||||||
schema,
|
&schema,
|
||||||
instance,
|
instance,
|
||||||
HashSet::new(),
|
HashSet::new(),
|
||||||
false,
|
false,
|
||||||
|
|||||||
@ -23,10 +23,13 @@ impl<'a> ValidationContext<'a> {
|
|||||||
// Entity implicit type validation
|
// Entity implicit type validation
|
||||||
if let Some(ref schema_identifier_str) = schema_identifier {
|
if let Some(ref schema_identifier_str) = schema_identifier {
|
||||||
// We decompose identity string routing inherently
|
// We decompose identity string routing inherently
|
||||||
let expected_type = schema_identifier_str.split('.').last().unwrap_or(schema_identifier_str);
|
let expected_type = schema_identifier_str
|
||||||
|
.split('.')
|
||||||
|
.last()
|
||||||
|
.unwrap_or(schema_identifier_str);
|
||||||
|
|
||||||
// Check if the identifier represents a registered global database entity boundary mathematically
|
// Check if the identifier represents a registered global database entity boundary mathematically
|
||||||
if let Some(type_def) = self.db.types.get(expected_type) {
|
if let Some(type_def) = self.db.types.get(expected_type).filter(|t| !t.variations.is_empty()) {
|
||||||
if let Some(type_val) = obj.get("type") {
|
if let Some(type_val) = obj.get("type") {
|
||||||
if let Some(type_str) = type_val.as_str() {
|
if let Some(type_str) = type_val.as_str() {
|
||||||
if type_def.variations.contains(type_str) {
|
if type_def.variations.contains(type_str) {
|
||||||
@ -47,21 +50,28 @@ impl<'a> ValidationContext<'a> {
|
|||||||
// Because it's a global entity target, the payload must structurally provide a discriminator natively
|
// Because it's a global entity target, the payload must structurally provide a discriminator natively
|
||||||
result.errors.push(ValidationError {
|
result.errors.push(ValidationError {
|
||||||
code: "MISSING_TYPE".to_string(),
|
code: "MISSING_TYPE".to_string(),
|
||||||
message: format!("Schema mechanically requires type discrimination '{}'", expected_type),
|
message: format!(
|
||||||
|
"Schema mechanically requires type discrimination '{}'",
|
||||||
|
expected_type
|
||||||
|
),
|
||||||
path: self.path.clone(), // Empty boundary
|
path: self.path.clone(), // Empty boundary
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the target mathematically declares a horizontal structural STI variation natively
|
// If the target mathematically declares a horizontal structural STI variation natively
|
||||||
if schema_identifier_str.contains('.') {
|
if schema_identifier_str.contains('.') {
|
||||||
let requires_kind = self.schema.compiled_properties.get()
|
let requires_kind = self
|
||||||
.map_or(false, |p| p.contains_key("kind"));
|
.schema
|
||||||
|
.compiled_properties
|
||||||
|
.get()
|
||||||
|
.map_or(false, |p| p.contains_key("kind"));
|
||||||
|
|
||||||
if requires_kind {
|
if requires_kind {
|
||||||
if obj.get("kind").is_none() {
|
if obj.get("kind").is_none() {
|
||||||
result.errors.push(ValidationError {
|
result.errors.push(ValidationError {
|
||||||
code: "MISSING_KIND".to_string(),
|
code: "MISSING_KIND".to_string(),
|
||||||
message: "Schema mechanically requires horizontal kind discrimination".to_string(),
|
message: "Schema mechanically requires horizontal kind discrimination"
|
||||||
|
.to_string(),
|
||||||
path: self.path.clone(),
|
path: self.path.clone(),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -74,20 +84,20 @@ impl<'a> ValidationContext<'a> {
|
|||||||
// Because they lack manual type property descriptors, we natively shield "type" and "kind" keys from
|
// Because they lack manual type property descriptors, we natively shield "type" and "kind" keys from
|
||||||
// triggering additionalProperty violations natively IF they precisely correspond to their fast-path boundaries
|
// triggering additionalProperty violations natively IF they precisely correspond to their fast-path boundaries
|
||||||
if let Some(type_val) = obj.get("type") {
|
if let Some(type_val) = obj.get("type") {
|
||||||
if let Some(type_str) = type_val.as_str() {
|
if let Some(type_str) = type_val.as_str() {
|
||||||
if type_str == expected_type {
|
if type_str == expected_type {
|
||||||
result.evaluated_keys.insert("type".to_string());
|
result.evaluated_keys.insert("type".to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(kind_val) = obj.get("kind") {
|
if let Some(kind_val) = obj.get("kind") {
|
||||||
if let Some((kind_str, _)) = schema_identifier_str.rsplit_once('.') {
|
if let Some((kind_str, _)) = schema_identifier_str.rsplit_once('.') {
|
||||||
if let Some(actual_kind) = kind_val.as_str() {
|
if let Some(actual_kind) = kind_val.as_str() {
|
||||||
if actual_kind == kind_str {
|
if actual_kind == kind_str {
|
||||||
result.evaluated_keys.insert("kind".to_string());
|
result.evaluated_keys.insert("kind".to_string());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -167,7 +177,9 @@ impl<'a> ValidationContext<'a> {
|
|||||||
if let Some(child_instance) = obj.get(key) {
|
if let Some(child_instance) = obj.get(key) {
|
||||||
let new_path = self.join_path(key);
|
let new_path = self.join_path(key);
|
||||||
let is_ref = match &sub_schema.type_ {
|
let is_ref = match &sub_schema.type_ {
|
||||||
Some(crate::database::object::SchemaTypeOrArray::Single(t)) => !crate::database::object::is_primitive_type(t),
|
Some(crate::database::object::SchemaTypeOrArray::Single(t)) => {
|
||||||
|
!crate::database::object::is_primitive_type(t)
|
||||||
|
}
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
let next_extensible = if is_ref { false } else { self.extensible };
|
let next_extensible = if is_ref { false } else { self.extensible };
|
||||||
@ -182,8 +194,6 @@ impl<'a> ValidationContext<'a> {
|
|||||||
);
|
);
|
||||||
let item_res = derived.validate()?;
|
let item_res = derived.validate()?;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
result.merge(item_res);
|
result.merge(item_res);
|
||||||
result.evaluated_keys.insert(key.to_string());
|
result.evaluated_keys.insert(key.to_string());
|
||||||
}
|
}
|
||||||
@ -196,7 +206,9 @@ impl<'a> ValidationContext<'a> {
|
|||||||
if compiled_re.0.is_match(key) {
|
if compiled_re.0.is_match(key) {
|
||||||
let new_path = self.join_path(key);
|
let new_path = self.join_path(key);
|
||||||
let is_ref = match &sub_schema.type_ {
|
let is_ref = match &sub_schema.type_ {
|
||||||
Some(crate::database::object::SchemaTypeOrArray::Single(t)) => !crate::database::object::is_primitive_type(t),
|
Some(crate::database::object::SchemaTypeOrArray::Single(t)) => {
|
||||||
|
!crate::database::object::is_primitive_type(t)
|
||||||
|
}
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
let next_extensible = if is_ref { false } else { self.extensible };
|
let next_extensible = if is_ref { false } else { self.extensible };
|
||||||
@ -225,7 +237,8 @@ impl<'a> ValidationContext<'a> {
|
|||||||
{
|
{
|
||||||
locally_matched = true;
|
locally_matched = true;
|
||||||
}
|
}
|
||||||
if !locally_matched && let Some(compiled_pp) = self.schema.compiled_pattern_properties.get()
|
if !locally_matched
|
||||||
|
&& let Some(compiled_pp) = self.schema.compiled_pattern_properties.get()
|
||||||
{
|
{
|
||||||
for (compiled_re, _) in compiled_pp {
|
for (compiled_re, _) in compiled_pp {
|
||||||
if compiled_re.0.is_match(key) {
|
if compiled_re.0.is_match(key) {
|
||||||
@ -238,7 +251,9 @@ impl<'a> ValidationContext<'a> {
|
|||||||
if !locally_matched {
|
if !locally_matched {
|
||||||
let new_path = self.join_path(key);
|
let new_path = self.join_path(key);
|
||||||
let is_ref = match &additional_schema.type_ {
|
let is_ref = match &additional_schema.type_ {
|
||||||
Some(crate::database::object::SchemaTypeOrArray::Single(t)) => !crate::database::object::is_primitive_type(t),
|
Some(crate::database::object::SchemaTypeOrArray::Single(t)) => {
|
||||||
|
!crate::database::object::is_primitive_type(t)
|
||||||
|
}
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
let next_extensible = if is_ref { false } else { self.extensible };
|
let next_extensible = if is_ref { false } else { self.extensible };
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
use crate::validator::context::ValidationContext;
|
use crate::validator::context::ValidationContext;
|
||||||
use crate::validator::error::ValidationError;
|
use crate::validator::error::ValidationError;
|
||||||
use crate::validator::result::ValidationResult;
|
use crate::validator::result::ValidationResult;
|
||||||
|
use crate::database::realm::SchemaRealm;
|
||||||
|
|
||||||
impl<'a> ValidationContext<'a> {
|
impl<'a> ValidationContext<'a> {
|
||||||
pub(crate) fn validate_family(
|
pub(crate) fn validate_family(
|
||||||
@ -99,8 +100,8 @@ impl<'a> ValidationContext<'a> {
|
|||||||
if let Some(val) = instance_val {
|
if let Some(val) = instance_val {
|
||||||
if let Some((idx_opt, target_id_opt)) = options.get(&val) {
|
if let Some((idx_opt, target_id_opt)) = options.get(&val) {
|
||||||
if let Some(target_id) = target_id_opt {
|
if let Some(target_id) = target_id_opt {
|
||||||
if let Some(target_schema) = self.db.schemas.get(target_id) {
|
if let Some(target_schema) = self.db.get_scoped_schema(SchemaRealm::Type, target_id) {
|
||||||
let derived = self.derive_for_schema(target_schema.as_ref(), false);
|
let derived = self.derive_for_schema(&target_schema, false);
|
||||||
let sub_res = derived.validate()?;
|
let sub_res = derived.validate()?;
|
||||||
let is_valid = sub_res.is_valid();
|
let is_valid = sub_res.is_valid();
|
||||||
result.merge(sub_res);
|
result.merge(sub_res);
|
||||||
@ -221,21 +222,21 @@ impl<'a> ValidationContext<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for t in custom_types {
|
for t in custom_types {
|
||||||
if let Some(global_schema) = self.db.schemas.get(&t) {
|
if let Some(global_schema) = self.db.get_scoped_schema(SchemaRealm::Type, &t) {
|
||||||
let mut new_overrides = self.overrides.clone();
|
let mut new_overrides = self.overrides.clone();
|
||||||
if let Some(props) = &self.schema.properties {
|
if let Some(props) = &self.schema.properties {
|
||||||
new_overrides.extend(props.keys().map(|k| k.to_string()));
|
new_overrides.extend(props.keys().map(|k| k.to_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut shadow = self.derive(
|
let mut shadow = self.derive(
|
||||||
global_schema,
|
&global_schema,
|
||||||
self.instance,
|
self.instance,
|
||||||
&self.path,
|
&self.path,
|
||||||
new_overrides,
|
new_overrides,
|
||||||
self.extensible,
|
self.extensible,
|
||||||
true, // Reporter mode
|
true, // Reporter mode
|
||||||
);
|
);
|
||||||
shadow.root = global_schema;
|
shadow.root = &global_schema;
|
||||||
result.merge(shadow.validate()?);
|
result.merge(shadow.validate()?);
|
||||||
} else {
|
} else {
|
||||||
result.errors.push(ValidationError {
|
result.errors.push(ValidationError {
|
||||||
|
|||||||
81
test_failures.log
Normal file
81
test_failures.log
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.43s
|
||||||
|
Running unittests src/lib.rs (target/debug/deps/jspg-d3f18ff3a7e2b386)
|
||||||
|
|
||||||
|
running 11 tests
|
||||||
|
test tests::test_minimum_0_2 ... ok
|
||||||
|
test tests::test_minimum_1_4 ... ok
|
||||||
|
test tests::test_minimum_1_0 ... FAILED
|
||||||
|
test tests::test_minimum_1_1 ... FAILED
|
||||||
|
test tests::test_minimum_0_3 ... FAILED
|
||||||
|
test tests::test_minimum_1_5 ... ok
|
||||||
|
test tests::test_minimum_1_3 ... FAILED
|
||||||
|
test tests::test_minimum_0_0 ... FAILED
|
||||||
|
test tests::test_minimum_0_1 ... FAILED
|
||||||
|
test tests::test_minimum_1_2 ... FAILED
|
||||||
|
test tests::test_minimum_1_6 ... FAILED
|
||||||
|
|
||||||
|
failures:
|
||||||
|
|
||||||
|
---- tests::test_minimum_1_0 stdout ----
|
||||||
|
TEST VALIDATE ERROR FOR 'negative above the minimum is valid': Expected success: true, Got: false. Actual Errors: [Error { code: "SCHEMA_NOT_FOUND", message: "Schema minimum_1_0 not found", details: ErrorDetails { path: Some("/"), cause: None, context: None, schema: None } }]
|
||||||
|
|
||||||
|
thread 'tests::test_minimum_1_0' (110318318) panicked at src/tests/fixtures.rs:3503:54:
|
||||||
|
called `Result::unwrap()` on an `Err` value: "[minimum validation with signed integer] Validate Test 'negative above the minimum is valid' failed. Error: Expected success: true, Got: false. Actual Errors: [Error { code: \"SCHEMA_NOT_FOUND\", message: \"Schema minimum_1_0 not found\", details: ErrorDetails { path: Some(\"/\"), cause: None, context: None, schema: None } }]"
|
||||||
|
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||||
|
|
||||||
|
---- tests::test_minimum_1_1 stdout ----
|
||||||
|
TEST VALIDATE ERROR FOR 'positive above the minimum is valid': Expected success: true, Got: false. Actual Errors: [Error { code: "SCHEMA_NOT_FOUND", message: "Schema minimum_1_0 not found", details: ErrorDetails { path: Some("/"), cause: None, context: None, schema: None } }]
|
||||||
|
|
||||||
|
thread 'tests::test_minimum_1_1' (110318319) panicked at src/tests/fixtures.rs:3509:54:
|
||||||
|
called `Result::unwrap()` on an `Err` value: "[minimum validation with signed integer] Validate Test 'positive above the minimum is valid' failed. Error: Expected success: true, Got: false. Actual Errors: [Error { code: \"SCHEMA_NOT_FOUND\", message: \"Schema minimum_1_0 not found\", details: ErrorDetails { path: Some(\"/\"), cause: None, context: None, schema: None } }]"
|
||||||
|
|
||||||
|
---- tests::test_minimum_0_3 stdout ----
|
||||||
|
TEST VALIDATE ERROR FOR 'ignores non-numbers': Expected success: true, Got: false. Actual Errors: [Error { code: "SCHEMA_NOT_FOUND", message: "Schema minimum_0_0 not found", details: ErrorDetails { path: Some("/"), cause: None, context: None, schema: None } }]
|
||||||
|
|
||||||
|
thread 'tests::test_minimum_0_3' (110318317) panicked at src/tests/fixtures.rs:3497:54:
|
||||||
|
called `Result::unwrap()` on an `Err` value: "[minimum validation] Validate Test 'ignores non-numbers' failed. Error: Expected success: true, Got: false. Actual Errors: [Error { code: \"SCHEMA_NOT_FOUND\", message: \"Schema minimum_0_0 not found\", details: ErrorDetails { path: Some(\"/\"), cause: None, context: None, schema: None } }]"
|
||||||
|
|
||||||
|
---- tests::test_minimum_1_3 stdout ----
|
||||||
|
TEST VALIDATE ERROR FOR 'boundary point with float is valid': Expected success: true, Got: false. Actual Errors: [Error { code: "SCHEMA_NOT_FOUND", message: "Schema minimum_1_0 not found", details: ErrorDetails { path: Some("/"), cause: None, context: None, schema: None } }]
|
||||||
|
|
||||||
|
thread 'tests::test_minimum_1_3' (110318321) panicked at src/tests/fixtures.rs:3521:54:
|
||||||
|
called `Result::unwrap()` on an `Err` value: "[minimum validation with signed integer] Validate Test 'boundary point with float is valid' failed. Error: Expected success: true, Got: false. Actual Errors: [Error { code: \"SCHEMA_NOT_FOUND\", message: \"Schema minimum_1_0 not found\", details: ErrorDetails { path: Some(\"/\"), cause: None, context: None, schema: None } }]"
|
||||||
|
|
||||||
|
---- tests::test_minimum_0_0 stdout ----
|
||||||
|
TEST VALIDATE ERROR FOR 'above the minimum is valid': Expected success: true, Got: false. Actual Errors: [Error { code: "SCHEMA_NOT_FOUND", message: "Schema minimum_0_0 not found", details: ErrorDetails { path: Some("/"), cause: None, context: None, schema: None } }]
|
||||||
|
|
||||||
|
thread 'tests::test_minimum_0_0' (110318314) panicked at src/tests/fixtures.rs:3479:54:
|
||||||
|
called `Result::unwrap()` on an `Err` value: "[minimum validation] Validate Test 'above the minimum is valid' failed. Error: Expected success: true, Got: false. Actual Errors: [Error { code: \"SCHEMA_NOT_FOUND\", message: \"Schema minimum_0_0 not found\", details: ErrorDetails { path: Some(\"/\"), cause: None, context: None, schema: None } }]"
|
||||||
|
|
||||||
|
---- tests::test_minimum_0_1 stdout ----
|
||||||
|
TEST VALIDATE ERROR FOR 'boundary point is valid': Expected success: true, Got: false. Actual Errors: [Error { code: "SCHEMA_NOT_FOUND", message: "Schema minimum_0_0 not found", details: ErrorDetails { path: Some("/"), cause: None, context: None, schema: None } }]
|
||||||
|
|
||||||
|
thread 'tests::test_minimum_0_1' (110318315) panicked at src/tests/fixtures.rs:3485:54:
|
||||||
|
called `Result::unwrap()` on an `Err` value: "[minimum validation] Validate Test 'boundary point is valid' failed. Error: Expected success: true, Got: false. Actual Errors: [Error { code: \"SCHEMA_NOT_FOUND\", message: \"Schema minimum_0_0 not found\", details: ErrorDetails { path: Some(\"/\"), cause: None, context: None, schema: None } }]"
|
||||||
|
|
||||||
|
---- tests::test_minimum_1_2 stdout ----
|
||||||
|
TEST VALIDATE ERROR FOR 'boundary point is valid': Expected success: true, Got: false. Actual Errors: [Error { code: "SCHEMA_NOT_FOUND", message: "Schema minimum_1_0 not found", details: ErrorDetails { path: Some("/"), cause: None, context: None, schema: None } }]
|
||||||
|
|
||||||
|
thread 'tests::test_minimum_1_2' (110318320) panicked at src/tests/fixtures.rs:3515:54:
|
||||||
|
called `Result::unwrap()` on an `Err` value: "[minimum validation with signed integer] Validate Test 'boundary point is valid' failed. Error: Expected success: true, Got: false. Actual Errors: [Error { code: \"SCHEMA_NOT_FOUND\", message: \"Schema minimum_1_0 not found\", details: ErrorDetails { path: Some(\"/\"), cause: None, context: None, schema: None } }]"
|
||||||
|
|
||||||
|
---- tests::test_minimum_1_6 stdout ----
|
||||||
|
TEST VALIDATE ERROR FOR 'ignores non-numbers': Expected success: true, Got: false. Actual Errors: [Error { code: "SCHEMA_NOT_FOUND", message: "Schema minimum_1_0 not found", details: ErrorDetails { path: Some("/"), cause: None, context: None, schema: None } }]
|
||||||
|
|
||||||
|
thread 'tests::test_minimum_1_6' (110318324) panicked at src/tests/fixtures.rs:3539:54:
|
||||||
|
called `Result::unwrap()` on an `Err` value: "[minimum validation with signed integer] Validate Test 'ignores non-numbers' failed. Error: Expected success: true, Got: false. Actual Errors: [Error { code: \"SCHEMA_NOT_FOUND\", message: \"Schema minimum_1_0 not found\", details: ErrorDetails { path: Some(\"/\"), cause: None, context: None, schema: None } }]"
|
||||||
|
|
||||||
|
|
||||||
|
failures:
|
||||||
|
tests::test_minimum_0_0
|
||||||
|
tests::test_minimum_0_1
|
||||||
|
tests::test_minimum_0_3
|
||||||
|
tests::test_minimum_1_0
|
||||||
|
tests::test_minimum_1_1
|
||||||
|
tests::test_minimum_1_2
|
||||||
|
tests::test_minimum_1_3
|
||||||
|
tests::test_minimum_1_6
|
||||||
|
|
||||||
|
test result: FAILED. 3 passed; 8 failed; 0 ignored; 0 measured; 1347 filtered out; finished in 0.00s
|
||||||
|
|
||||||
|
error: test failed, to rerun pass `--lib`
|
||||||
23
test_merge.log
Normal file
23
test_merge.log
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Compiling jspg v0.1.0 (/Users/awgneo/Repositories/thoughtpatterns/cellular/jspg)
|
||||||
|
Finished `test` profile [unoptimized + debuginfo] target(s) in 7.59s
|
||||||
|
Running unittests src/lib.rs (target/debug/deps/jspg-d3f18ff3a7e2b386)
|
||||||
|
|
||||||
|
running 1 test
|
||||||
|
test tests::test_merge_0_0 ... FAILED
|
||||||
|
|
||||||
|
failures:
|
||||||
|
|
||||||
|
---- tests::test_merge_0_0 stdout ----
|
||||||
|
TEST VALIDATE ERROR FOR 'valid with both properties': Expected success: true, Got: false. Actual Errors: [Error { code: "MISSING_TYPE", message: "Schema mechanically requires type discrimination 'base_0'", details: ErrorDetails { path: Some(""), cause: None, context: None, schema: None } }]
|
||||||
|
|
||||||
|
thread 'tests::test_merge_0_0' (110369726) panicked at src/tests/fixtures.rs:4307:54:
|
||||||
|
called `Result::unwrap()` on an `Err` value: "[merging: properties accumulate] Validate Test 'valid with both properties' failed. Error: Expected success: true, Got: false. Actual Errors: [Error { code: \"MISSING_TYPE\", message: \"Schema mechanically requires type discrimination 'base_0'\", details: ErrorDetails { path: Some(\"\"), cause: None, context: None, schema: None } }]"
|
||||||
|
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||||
|
|
||||||
|
|
||||||
|
failures:
|
||||||
|
tests::test_merge_0_0
|
||||||
|
|
||||||
|
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1357 filtered out; finished in 0.00s
|
||||||
|
|
||||||
|
error: test failed, to rerun pass `--lib`
|
||||||
Reference in New Issue
Block a user