significantly simplified the validator and work continues on query

This commit is contained in:
2026-03-03 17:58:31 -05:00
parent 3898c43742
commit e7f20e2cb6
58 changed files with 5446 additions and 5693 deletions

View File

@ -4,7 +4,7 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema1",
"properties": {
"foo": {
"type": "string"
@ -26,7 +26,8 @@
"foo": "value",
"bar": 123
},
"valid": true
"valid": true,
"schema_id": "schema1"
},
{
"description": "additional property matching schema is valid",
@ -35,7 +36,8 @@
"is_active": true,
"hidden": false
},
"valid": true
"valid": true,
"schema_id": "schema1"
},
{
"description": "additional property not matching schema is invalid",
@ -43,7 +45,8 @@
"foo": "value",
"is_active": 1
},
"valid": false
"valid": false,
"schema_id": "schema1"
}
]
},
@ -52,7 +55,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {
"type": "string"
@ -61,7 +63,8 @@
"extensible": true,
"additionalProperties": {
"type": "integer"
}
},
"$id": "additionalProperties_1_0"
}
]
},
@ -73,7 +76,8 @@
"count": 5,
"age": 42
},
"valid": true
"valid": true,
"schema_id": "additionalProperties_1_0"
},
{
"description": "additional property not matching schema is invalid despite extensible: true",
@ -81,7 +85,8 @@
"foo": "hello",
"count": "five"
},
"valid": false
"valid": false,
"schema_id": "additionalProperties_1_0"
}
]
},
@ -90,7 +95,7 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema3",
"properties": {
"type": {
"type": "string"
@ -118,7 +123,8 @@
"field3"
]
},
"valid": true
"valid": true,
"schema_id": "schema3"
},
{
"description": "invalid array of integers",
@ -129,7 +135,8 @@
2
]
},
"valid": false
"valid": false,
"schema_id": "schema3"
},
{
"description": "invalid non-array type",
@ -137,7 +144,8 @@
"type": "my_type",
"group_a": "field1"
},
"valid": false
"valid": false,
"schema_id": "schema3"
}
]
}

View File

@ -4,7 +4,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"properties": {
@ -26,7 +25,8 @@
"foo"
]
}
]
],
"$id": "allOf_0_0"
}
]
},
@ -37,21 +37,24 @@
"foo": "baz",
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "allOf_0_0"
},
{
"description": "mismatch second",
"data": {
"foo": "baz"
},
"valid": false
"valid": false,
"schema_id": "allOf_0_0"
},
{
"description": "mismatch first",
"data": {
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "allOf_0_0"
},
{
"description": "wrong type",
@ -59,7 +62,8 @@
"foo": "baz",
"bar": "quux"
},
"valid": false
"valid": false,
"schema_id": "allOf_0_0"
}
]
},
@ -68,7 +72,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"bar": {
"type": "integer"
@ -102,7 +105,8 @@
"baz"
]
}
]
],
"$id": "allOf_1_0"
}
]
},
@ -114,7 +118,8 @@
"bar": 2,
"baz": null
},
"valid": true
"valid": true,
"schema_id": "allOf_1_0"
},
{
"description": "mismatch base schema",
@ -122,7 +127,8 @@
"foo": "quux",
"baz": null
},
"valid": false
"valid": false,
"schema_id": "allOf_1_0"
},
{
"description": "mismatch first allOf",
@ -130,7 +136,8 @@
"bar": 2,
"baz": null
},
"valid": false
"valid": false,
"schema_id": "allOf_1_0"
},
{
"description": "mismatch second allOf",
@ -138,14 +145,16 @@
"foo": "quux",
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "allOf_1_0"
},
{
"description": "mismatch both",
"data": {
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "allOf_1_0"
}
]
},
@ -154,7 +163,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"maximum": 30
@ -162,7 +170,8 @@
{
"minimum": 20
}
]
],
"$id": "allOf_2_0"
}
]
},
@ -170,12 +179,14 @@
{
"description": "valid",
"data": 25,
"valid": true
"valid": true,
"schema_id": "allOf_2_0"
},
{
"description": "mismatch one",
"data": 35,
"valid": false
"valid": false,
"schema_id": "allOf_2_0"
}
]
},
@ -184,11 +195,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
true,
true
]
],
"$id": "allOf_3_0"
}
]
},
@ -196,7 +207,8 @@
{
"description": "any value is valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "allOf_3_0"
}
]
},
@ -205,11 +217,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
true,
false
]
],
"$id": "allOf_4_0"
}
]
},
@ -217,7 +229,8 @@
{
"description": "any value is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "allOf_4_0"
}
]
},
@ -226,11 +239,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
false,
false
]
],
"$id": "allOf_5_0"
}
]
},
@ -238,7 +251,8 @@
{
"description": "any value is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "allOf_5_0"
}
]
},
@ -247,10 +261,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{}
]
],
"$id": "allOf_6_0"
}
]
},
@ -258,7 +272,8 @@
{
"description": "any data is valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "allOf_6_0"
}
]
},
@ -267,11 +282,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{},
{}
]
],
"$id": "allOf_7_0"
}
]
},
@ -279,7 +294,8 @@
{
"description": "any data is valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "allOf_7_0"
}
]
},
@ -288,13 +304,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{},
{
"type": "number"
}
]
],
"$id": "allOf_8_0"
}
]
},
@ -302,12 +318,14 @@
{
"description": "number is valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "allOf_8_0"
},
{
"description": "string is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "allOf_8_0"
}
]
},
@ -316,13 +334,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"type": "number"
},
{}
]
],
"$id": "allOf_9_0"
}
]
},
@ -330,12 +348,14 @@
{
"description": "number is valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "allOf_9_0"
},
{
"description": "string is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "allOf_9_0"
}
]
},
@ -344,7 +364,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"allOf": [
@ -353,7 +372,8 @@
}
]
}
]
],
"$id": "allOf_10_0"
}
]
},
@ -361,12 +381,14 @@
{
"description": "null is valid",
"data": null,
"valid": true
"valid": true,
"schema_id": "allOf_10_0"
},
{
"description": "anything non-null is invalid",
"data": 123,
"valid": false
"valid": false,
"schema_id": "allOf_10_0"
}
]
},
@ -375,7 +397,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"multipleOf": 2
@ -390,7 +411,8 @@
{
"multipleOf": 5
}
]
],
"$id": "allOf_11_0"
}
]
},
@ -398,42 +420,50 @@
{
"description": "allOf: false, anyOf: false, oneOf: false",
"data": 1,
"valid": false
"valid": false,
"schema_id": "allOf_11_0"
},
{
"description": "allOf: false, anyOf: false, oneOf: true",
"data": 5,
"valid": false
"valid": false,
"schema_id": "allOf_11_0"
},
{
"description": "allOf: false, anyOf: true, oneOf: false",
"data": 3,
"valid": false
"valid": false,
"schema_id": "allOf_11_0"
},
{
"description": "allOf: false, anyOf: true, oneOf: true",
"data": 15,
"valid": false
"valid": false,
"schema_id": "allOf_11_0"
},
{
"description": "allOf: true, anyOf: false, oneOf: false",
"data": 2,
"valid": false
"valid": false,
"schema_id": "allOf_11_0"
},
{
"description": "allOf: true, anyOf: false, oneOf: true",
"data": 10,
"valid": false
"valid": false,
"schema_id": "allOf_11_0"
},
{
"description": "allOf: true, anyOf: true, oneOf: false",
"data": 6,
"valid": false
"valid": false,
"schema_id": "allOf_11_0"
},
{
"description": "allOf: true, anyOf: true, oneOf: true",
"data": 30,
"valid": true
"valid": true,
"schema_id": "allOf_11_0"
}
]
},
@ -442,7 +472,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"properties": {
@ -465,7 +494,8 @@
]
}
],
"extensible": true
"extensible": true,
"$id": "allOf_12_0"
}
]
},
@ -477,7 +507,8 @@
"bar": 2,
"qux": 3
},
"valid": true
"valid": true,
"schema_id": "allOf_12_0"
}
]
},
@ -486,7 +517,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"properties": {
@ -502,7 +532,8 @@
}
}
}
]
],
"$id": "allOf_13_0"
}
]
},
@ -513,7 +544,8 @@
"foo": 1,
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "allOf_13_0"
},
{
"description": "fails on extra property z explicitly",
@ -522,7 +554,8 @@
"bar": 2,
"z": 3
},
"valid": false
"valid": false,
"schema_id": "allOf_13_0"
}
]
},
@ -531,7 +564,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"properties": {
@ -548,7 +580,8 @@
}
}
}
]
],
"$id": "allOf_14_0"
}
]
},
@ -560,7 +593,8 @@
"bar": 2,
"z": 3
},
"valid": true
"valid": true,
"schema_id": "allOf_14_0"
}
]
},
@ -571,26 +605,27 @@
{
"allOf": [
{
"$ref": "#/$defs/partA"
"$ref": "partA"
},
{
"$ref": "#/$defs/partB"
"$ref": "partB"
}
],
"$defs": {
"partA": {
"properties": {
"id": {
"type": "string"
}
}
},
"partB": {
"properties": {
"name": {
"type": "string"
}
}
"$id": "allOf_15_0"
},
{
"$id": "partA",
"properties": {
"id": {
"type": "string"
}
}
},
{
"$id": "partB",
"properties": {
"name": {
"type": "string"
}
}
}
@ -603,7 +638,8 @@
"id": "1",
"name": "Me"
},
"valid": true
"valid": true,
"schema_id": "allOf_15_0"
},
{
"description": "extra property is invalid (root is strict)",
@ -612,7 +648,8 @@
"name": "Me",
"extra": 1
},
"valid": false
"valid": false,
"schema_id": "allOf_15_0"
},
{
"description": "partA mismatch is invalid",
@ -620,7 +657,8 @@
"id": 1,
"name": "Me"
},
"valid": false
"valid": false,
"schema_id": "allOf_15_0"
}
]
}

View File

@ -4,7 +4,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "integer"
@ -12,7 +11,8 @@
{
"minimum": 2
}
]
],
"$id": "anyOf_0_0"
}
]
},
@ -20,22 +20,26 @@
{
"description": "first anyOf valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "anyOf_0_0"
},
{
"description": "second anyOf valid",
"data": 2.5,
"valid": true
"valid": true,
"schema_id": "anyOf_0_0"
},
{
"description": "both anyOf valid",
"data": 3,
"valid": true
"valid": true,
"schema_id": "anyOf_0_0"
},
{
"description": "neither anyOf valid",
"data": 1.5,
"valid": false
"valid": false,
"schema_id": "anyOf_0_0"
}
]
},
@ -44,7 +48,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"anyOf": [
{
@ -53,7 +56,8 @@
{
"minLength": 4
}
]
],
"$id": "anyOf_1_0"
}
]
},
@ -61,17 +65,20 @@
{
"description": "mismatch base schema",
"data": 3,
"valid": false
"valid": false,
"schema_id": "anyOf_1_0"
},
{
"description": "one anyOf valid",
"data": "foobar",
"valid": true
"valid": true,
"schema_id": "anyOf_1_0"
},
{
"description": "both anyOf invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "anyOf_1_0"
}
]
},
@ -80,11 +87,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
true,
true
]
],
"$id": "anyOf_2_0"
}
]
},
@ -92,7 +99,8 @@
{
"description": "any value is valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "anyOf_2_0"
}
]
},
@ -101,11 +109,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
true,
false
]
],
"$id": "anyOf_3_0"
}
]
},
@ -113,7 +121,8 @@
{
"description": "any value is valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "anyOf_3_0"
}
]
},
@ -122,11 +131,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
false,
false
]
],
"$id": "anyOf_4_0"
}
]
},
@ -134,7 +143,8 @@
{
"description": "any value is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "anyOf_4_0"
}
]
},
@ -143,7 +153,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"properties": {
@ -165,7 +174,8 @@
"foo"
]
}
]
],
"$id": "anyOf_5_0"
}
]
},
@ -175,14 +185,16 @@
"data": {
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "anyOf_5_0"
},
{
"description": "second anyOf valid (complex)",
"data": {
"foo": "baz"
},
"valid": true
"valid": true,
"schema_id": "anyOf_5_0"
},
{
"description": "both anyOf valid (complex)",
@ -190,7 +202,8 @@
"foo": "baz",
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "anyOf_5_0"
},
{
"description": "neither anyOf valid (complex)",
@ -198,7 +211,8 @@
"foo": 2,
"bar": "quux"
},
"valid": false
"valid": false,
"schema_id": "anyOf_5_0"
}
]
},
@ -207,13 +221,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "number"
},
{}
]
],
"$id": "anyOf_6_0"
}
]
},
@ -221,12 +235,14 @@
{
"description": "string is valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "anyOf_6_0"
},
{
"description": "number is valid",
"data": 123,
"valid": true
"valid": true,
"schema_id": "anyOf_6_0"
}
]
},
@ -235,7 +251,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"anyOf": [
@ -244,7 +259,8 @@
}
]
}
]
],
"$id": "anyOf_7_0"
}
]
},
@ -252,12 +268,14 @@
{
"description": "null is valid",
"data": null,
"valid": true
"valid": true,
"schema_id": "anyOf_7_0"
},
{
"description": "anything non-null is invalid",
"data": 123,
"valid": false
"valid": false,
"schema_id": "anyOf_7_0"
}
]
},
@ -266,7 +284,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "integer"
@ -275,7 +292,8 @@
"minimum": 2
}
],
"extensible": true
"extensible": true,
"$id": "anyOf_8_0"
}
]
},
@ -285,7 +303,8 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "anyOf_8_0"
}
]
},
@ -294,7 +313,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"properties": {
@ -310,7 +328,8 @@
}
}
}
]
],
"$id": "anyOf_9_0"
}
]
},
@ -320,7 +339,8 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "anyOf_9_0"
},
{
"description": "fails on extra property z explicitly",
@ -328,7 +348,8 @@
"foo": 1,
"z": 3
},
"valid": false
"valid": false,
"schema_id": "anyOf_9_0"
}
]
}

View File

@ -3,58 +3,69 @@
"description": "boolean schema 'true'",
"database": {
"schemas": [
true
{
"$id": "booleanSchema_0_0"
}
]
},
"tests": [
{
"description": "number is valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "booleanSchema_0_0"
},
{
"description": "string is valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "booleanSchema_0_0"
},
{
"description": "boolean true is valid",
"data": true,
"valid": true
"valid": true,
"schema_id": "booleanSchema_0_0"
},
{
"description": "boolean false is valid",
"data": false,
"valid": true
"valid": true,
"schema_id": "booleanSchema_0_0"
},
{
"description": "null is valid",
"data": null,
"valid": true
"valid": true,
"schema_id": "booleanSchema_0_0"
},
{
"description": "object is valid",
"data": {
"foo": "bar"
},
"valid": true
"valid": true,
"schema_id": "booleanSchema_0_0"
},
{
"description": "empty object is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "booleanSchema_0_0"
},
{
"description": "array is valid",
"data": [
"foo"
],
"valid": true
"valid": true,
"schema_id": "booleanSchema_0_0"
},
{
"description": "empty array is valid",
"data": [],
"valid": true
"valid": true,
"schema_id": "booleanSchema_0_0"
}
]
},
@ -62,58 +73,70 @@
"description": "boolean schema 'false'",
"database": {
"schemas": [
false
{
"not": {},
"$id": "booleanSchema_1_0"
}
]
},
"tests": [
{
"description": "number is invalid",
"data": 1,
"valid": false
"valid": false,
"schema_id": "booleanSchema_1_0"
},
{
"description": "string is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "booleanSchema_1_0"
},
{
"description": "boolean true is invalid",
"data": true,
"valid": false
"valid": false,
"schema_id": "booleanSchema_1_0"
},
{
"description": "boolean false is invalid",
"data": false,
"valid": false
"valid": false,
"schema_id": "booleanSchema_1_0"
},
{
"description": "null is invalid",
"data": null,
"valid": false
"valid": false,
"schema_id": "booleanSchema_1_0"
},
{
"description": "object is invalid",
"data": {
"foo": "bar"
},
"valid": false
"valid": false,
"schema_id": "booleanSchema_1_0"
},
{
"description": "empty object is invalid",
"data": {},
"valid": false
"valid": false,
"schema_id": "booleanSchema_1_0"
},
{
"description": "array is invalid",
"data": [
"foo"
],
"valid": false
"valid": false,
"schema_id": "booleanSchema_1_0"
},
{
"description": "empty array is invalid",
"data": [],
"valid": false
"valid": false,
"schema_id": "booleanSchema_1_0"
}
]
}

View File

@ -4,8 +4,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": 2
"const": 2,
"$id": "const_0_0"
}
]
},
@ -13,17 +13,20 @@
{
"description": "same value is valid",
"data": 2,
"valid": true
"valid": true,
"schema_id": "const_0_0"
},
{
"description": "another value is invalid",
"data": 5,
"valid": false
"valid": false,
"schema_id": "const_0_0"
},
{
"description": "another type is invalid",
"data": "a",
"valid": false
"valid": false,
"schema_id": "const_0_0"
}
]
},
@ -32,7 +35,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": {
"foo": "bar",
"baz": "bax"
@ -40,7 +42,8 @@
"properties": {
"foo": {},
"baz": {}
}
},
"$id": "const_1_0"
}
]
},
@ -51,7 +54,8 @@
"foo": "bar",
"baz": "bax"
},
"valid": true
"valid": true,
"schema_id": "const_1_0"
},
{
"description": "same object with different property order is valid",
@ -59,14 +63,16 @@
"baz": "bax",
"foo": "bar"
},
"valid": true
"valid": true,
"schema_id": "const_1_0"
},
{
"description": "another object is invalid",
"data": {
"foo": "bar"
},
"valid": false
"valid": false,
"schema_id": "const_1_0"
},
{
"description": "another type is invalid",
@ -74,7 +80,8 @@
1,
2
],
"valid": false
"valid": false,
"schema_id": "const_1_0"
}
]
},
@ -83,12 +90,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": [
{
"foo": "bar"
}
]
],
"$id": "const_2_0"
}
]
},
@ -100,14 +107,16 @@
"foo": "bar"
}
],
"valid": true
"valid": true,
"schema_id": "const_2_0"
},
{
"description": "another array item is invalid",
"data": [
2
],
"valid": false
"valid": false,
"schema_id": "const_2_0"
},
{
"description": "array with additional items is invalid",
@ -116,7 +125,8 @@
2,
3
],
"valid": false
"valid": false,
"schema_id": "const_2_0"
}
]
},
@ -125,8 +135,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": null
"const": null,
"$id": "const_3_0"
}
]
},
@ -134,12 +144,14 @@
{
"description": "null is valid",
"data": null,
"valid": true
"valid": true,
"schema_id": "const_3_0"
},
{
"description": "not null is invalid",
"data": 0,
"valid": false
"valid": false,
"schema_id": "const_3_0"
}
]
},
@ -148,8 +160,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": false
"const": false,
"$id": "const_4_0"
}
]
},
@ -157,17 +169,20 @@
{
"description": "false is valid",
"data": false,
"valid": true
"valid": true,
"schema_id": "const_4_0"
},
{
"description": "integer zero is invalid",
"data": 0,
"valid": false
"valid": false,
"schema_id": "const_4_0"
},
{
"description": "float zero is invalid",
"data": 0.0,
"valid": false
"data": 0,
"valid": false,
"schema_id": "const_4_0"
}
]
},
@ -176,8 +191,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": true
"const": true,
"$id": "const_5_0"
}
]
},
@ -185,17 +200,20 @@
{
"description": "true is valid",
"data": true,
"valid": true
"valid": true,
"schema_id": "const_5_0"
},
{
"description": "integer one is invalid",
"data": 1,
"valid": false
"valid": false,
"schema_id": "const_5_0"
},
{
"description": "float one is invalid",
"data": 1.0,
"valid": false
"data": 1,
"valid": false,
"schema_id": "const_5_0"
}
]
},
@ -204,10 +222,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": [
false
]
],
"$id": "const_6_0"
}
]
},
@ -217,21 +235,24 @@
"data": [
false
],
"valid": true
"valid": true,
"schema_id": "const_6_0"
},
{
"description": "[0] is invalid",
"data": [
0
],
"valid": false
"valid": false,
"schema_id": "const_6_0"
},
{
"description": "[0.0] is invalid",
"data": [
0.0
0
],
"valid": false
"valid": false,
"schema_id": "const_6_0"
}
]
},
@ -240,10 +261,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": [
true
]
],
"$id": "const_7_0"
}
]
},
@ -253,21 +274,24 @@
"data": [
true
],
"valid": true
"valid": true,
"schema_id": "const_7_0"
},
{
"description": "[1] is invalid",
"data": [
1
],
"valid": false
"valid": false,
"schema_id": "const_7_0"
},
{
"description": "[1.0] is invalid",
"data": [
1.0
1
],
"valid": false
"valid": false,
"schema_id": "const_7_0"
}
]
},
@ -276,10 +300,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": {
"a": false
}
},
"$id": "const_8_0"
}
]
},
@ -289,21 +313,24 @@
"data": {
"a": false
},
"valid": true
"valid": true,
"schema_id": "const_8_0"
},
{
"description": "{\"a\": 0} is invalid",
"data": {
"a": 0
},
"valid": false
"valid": false,
"schema_id": "const_8_0"
},
{
"description": "{\"a\": 0.0} is invalid",
"data": {
"a": 0.0
"a": 0
},
"valid": false
"valid": false,
"schema_id": "const_8_0"
}
]
},
@ -312,10 +339,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": {
"a": true
}
},
"$id": "const_9_0"
}
]
},
@ -325,21 +352,24 @@
"data": {
"a": true
},
"valid": true
"valid": true,
"schema_id": "const_9_0"
},
{
"description": "{\"a\": 1} is invalid",
"data": {
"a": 1
},
"valid": false
"valid": false,
"schema_id": "const_9_0"
},
{
"description": "{\"a\": 1.0} is invalid",
"data": {
"a": 1.0
"a": 1
},
"valid": false
"valid": false,
"schema_id": "const_9_0"
}
]
},
@ -348,8 +378,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": 0
"const": 0,
"$id": "const_10_0"
}
]
},
@ -357,32 +387,38 @@
{
"description": "false is invalid",
"data": false,
"valid": false
"valid": false,
"schema_id": "const_10_0"
},
{
"description": "integer zero is valid",
"data": 0,
"valid": true
"valid": true,
"schema_id": "const_10_0"
},
{
"description": "float zero is valid",
"data": 0.0,
"valid": true
"data": 0,
"valid": true,
"schema_id": "const_10_0"
},
{
"description": "empty object is invalid",
"data": {},
"valid": false
"valid": false,
"schema_id": "const_10_0"
},
{
"description": "empty array is invalid",
"data": [],
"valid": false
"valid": false,
"schema_id": "const_10_0"
},
{
"description": "empty string is invalid",
"data": "",
"valid": false
"valid": false,
"schema_id": "const_10_0"
}
]
},
@ -391,8 +427,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": 1
"const": 1,
"$id": "const_11_0"
}
]
},
@ -400,17 +436,20 @@
{
"description": "true is invalid",
"data": true,
"valid": false
"valid": false,
"schema_id": "const_11_0"
},
{
"description": "integer one is valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "const_11_0"
},
{
"description": "float one is valid",
"data": 1.0,
"valid": true
"data": 1,
"valid": true,
"schema_id": "const_11_0"
}
]
},
@ -419,8 +458,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": -2.0
"const": -2,
"$id": "const_12_0"
}
]
},
@ -428,27 +467,32 @@
{
"description": "integer -2 is valid",
"data": -2,
"valid": true
"valid": true,
"schema_id": "const_12_0"
},
{
"description": "integer 2 is invalid",
"data": 2,
"valid": false
"valid": false,
"schema_id": "const_12_0"
},
{
"description": "float -2.0 is valid",
"data": -2.0,
"valid": true
"data": -2,
"valid": true,
"schema_id": "const_12_0"
},
{
"description": "float 2.0 is invalid",
"data": 2.0,
"valid": false
"data": 2,
"valid": false,
"schema_id": "const_12_0"
},
{
"description": "float -2.00001 is invalid",
"data": -2.00001,
"valid": false
"valid": false,
"schema_id": "const_12_0"
}
]
},
@ -457,8 +501,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": 9007199254740992
"const": 9007199254740992,
"$id": "const_13_0"
}
]
},
@ -466,22 +510,26 @@
{
"description": "integer is valid",
"data": 9007199254740992,
"valid": true
"valid": true,
"schema_id": "const_13_0"
},
{
"description": "integer minus one is invalid",
"data": 9007199254740991,
"valid": false
"valid": false,
"schema_id": "const_13_0"
},
{
"description": "float is valid",
"data": 9007199254740992.0,
"valid": true
"data": 9007199254740992,
"valid": true,
"schema_id": "const_13_0"
},
{
"description": "float minus one is invalid",
"data": 9007199254740991.0,
"valid": false
"data": 9007199254740991,
"valid": false,
"schema_id": "const_13_0"
}
]
},
@ -490,8 +538,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": "hello\u0000there"
"const": "hello\u0000there",
"$id": "const_14_0"
}
]
},
@ -499,12 +547,14 @@
{
"description": "match string with nul",
"data": "hello\u0000there",
"valid": true
"valid": true,
"schema_id": "const_14_0"
},
{
"description": "do not match string lacking nul",
"data": "hellothere",
"valid": false
"valid": false,
"schema_id": "const_14_0"
}
]
},
@ -513,9 +563,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": "μ",
"$comment": "U+03BC"
"$comment": "U+03BC",
"$id": "const_15_0"
}
]
},
@ -524,13 +574,15 @@
"description": "character uses the same codepoint",
"data": "μ",
"comment": "U+03BC",
"valid": true
"valid": true,
"schema_id": "const_15_0"
},
{
"description": "character looks the same but uses a different codepoint",
"data": "µ",
"comment": "U+00B5",
"valid": false
"valid": false,
"schema_id": "const_15_0"
}
]
},
@ -539,9 +591,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": "ä",
"$comment": "U+00E4"
"$comment": "U+00E4",
"$id": "const_16_0"
}
]
},
@ -550,13 +602,15 @@
"description": "character uses the same codepoint",
"data": "ä",
"comment": "U+00E4",
"valid": true
"valid": true,
"schema_id": "const_16_0"
},
{
"description": "character looks the same but uses combining marks",
"data": "ä",
"comment": "a, U+0308",
"valid": false
"valid": false,
"schema_id": "const_16_0"
}
]
},
@ -565,11 +619,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"const": {
"a": 1
},
"extensible": true
"extensible": true,
"$id": "const_17_0"
}
]
},
@ -580,14 +634,16 @@
"a": 1,
"b": 2
},
"valid": false
"valid": false,
"schema_id": "const_17_0"
},
{
"description": "extra property match in const (this is effectively impossible if data has extra props not in const, it implicitly fails const check unless we assume const check ignored extra props? No, const check is strict. So this test is just to show strictness passes.)",
"data": {
"a": 1
},
"valid": true
"valid": true,
"schema_id": "const_17_0"
}
]
}

View File

@ -4,11 +4,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"minimum": 5
},
"items": true
"items": true,
"$id": "contains_0_0"
}
]
},
@ -20,7 +20,8 @@
4,
5
],
"valid": true
"valid": true,
"schema_id": "contains_0_0"
},
{
"description": "array with item matching schema (6) is valid (items: true)",
@ -29,7 +30,8 @@
4,
6
],
"valid": true
"valid": true,
"schema_id": "contains_0_0"
},
{
"description": "array with two items matching schema (5, 6) is valid (items: true)",
@ -39,7 +41,8 @@
5,
6
],
"valid": true
"valid": true,
"schema_id": "contains_0_0"
},
{
"description": "array without items matching schema is invalid",
@ -48,17 +51,20 @@
3,
4
],
"valid": false
"valid": false,
"schema_id": "contains_0_0"
},
{
"description": "empty array is invalid",
"data": [],
"valid": false
"valid": false,
"schema_id": "contains_0_0"
},
{
"description": "not array is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "contains_0_0"
}
]
},
@ -67,11 +73,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 5
},
"items": true
"items": true,
"$id": "contains_1_0"
}
]
},
@ -83,7 +89,8 @@
4,
5
],
"valid": true
"valid": true,
"schema_id": "contains_1_0"
},
{
"description": "array with two items 5 is valid (items: true)",
@ -93,7 +100,8 @@
5,
5
],
"valid": true
"valid": true,
"schema_id": "contains_1_0"
},
{
"description": "array without item 5 is invalid",
@ -103,7 +111,8 @@
3,
4
],
"valid": false
"valid": false,
"schema_id": "contains_1_0"
}
]
},
@ -112,8 +121,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": true
"contains": true,
"$id": "contains_2_0"
}
]
},
@ -123,12 +132,14 @@
"data": [
"foo"
],
"valid": true
"valid": true,
"schema_id": "contains_2_0"
},
{
"description": "empty array is invalid",
"data": [],
"valid": false
"valid": false,
"schema_id": "contains_2_0"
}
]
},
@ -137,8 +148,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": false
"contains": false,
"$id": "contains_3_0"
}
]
},
@ -148,17 +159,20 @@
"data": [
"foo"
],
"valid": false
"valid": false,
"schema_id": "contains_3_0"
},
{
"description": "empty array is invalid",
"data": [],
"valid": false
"valid": false,
"schema_id": "contains_3_0"
},
{
"description": "non-arrays are valid",
"data": "contains does not apply to strings",
"valid": true
"valid": true,
"schema_id": "contains_3_0"
}
]
},
@ -167,13 +181,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"items": {
"multipleOf": 2
},
"contains": {
"multipleOf": 3
}
},
"$id": "contains_4_0"
}
]
},
@ -185,7 +199,8 @@
4,
8
],
"valid": false
"valid": false,
"schema_id": "contains_4_0"
},
{
"description": "does not match items, matches contains",
@ -194,7 +209,8 @@
6,
9
],
"valid": false
"valid": false,
"schema_id": "contains_4_0"
},
{
"description": "matches both items and contains",
@ -202,7 +218,8 @@
6,
12
],
"valid": true
"valid": true,
"schema_id": "contains_4_0"
},
{
"description": "matches neither items nor contains",
@ -210,7 +227,8 @@
1,
5
],
"valid": false
"valid": false,
"schema_id": "contains_4_0"
}
]
},
@ -219,11 +237,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"if": false,
"else": true
}
},
"$id": "contains_5_0"
}
]
},
@ -233,12 +251,14 @@
"data": [
"foo"
],
"valid": true
"valid": true,
"schema_id": "contains_5_0"
},
{
"description": "empty array is invalid",
"data": [],
"valid": false
"valid": false,
"schema_id": "contains_5_0"
}
]
},
@ -247,10 +267,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"type": "null"
}
},
"$id": "contains_6_0"
}
]
},
@ -260,7 +280,8 @@
"data": [
null
],
"valid": true
"valid": true,
"schema_id": "contains_6_0"
}
]
},
@ -269,11 +290,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"extensible": true
"extensible": true,
"$id": "contains_7_0"
}
]
},
@ -284,7 +305,8 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "contains_7_0"
}
]
},
@ -293,10 +315,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
}
},
"$id": "contains_8_0"
}
]
},
@ -307,7 +329,8 @@
1,
2
],
"valid": false
"valid": false,
"schema_id": "contains_8_0"
},
{
"description": "only matching items is valid",
@ -315,7 +338,8 @@
1,
1
],
"valid": true
"valid": true,
"schema_id": "contains_8_0"
}
]
}

View File

@ -4,8 +4,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contentMediaType": "application/json"
"contentMediaType": "application/json",
"$id": "content_0_0"
}
]
},
@ -13,17 +13,20 @@
{
"description": "a valid JSON document",
"data": "{\"foo\": \"bar\"}",
"valid": true
"valid": true,
"schema_id": "content_0_0"
},
{
"description": "an invalid JSON document; validates true",
"data": "{:}",
"valid": true
"valid": true,
"schema_id": "content_0_0"
},
{
"description": "ignores non-strings",
"data": 100,
"valid": true
"valid": true,
"schema_id": "content_0_0"
}
]
},
@ -32,8 +35,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contentEncoding": "base64"
"contentEncoding": "base64",
"$id": "content_1_0"
}
]
},
@ -41,17 +44,20 @@
{
"description": "a valid base64 string",
"data": "eyJmb28iOiAiYmFyIn0K",
"valid": true
"valid": true,
"schema_id": "content_1_0"
},
{
"description": "an invalid base64 string (% is not a valid character); validates true",
"data": "eyJmb28iOi%iYmFyIn0K",
"valid": true
"valid": true,
"schema_id": "content_1_0"
},
{
"description": "ignores non-strings",
"data": 100,
"valid": true
"valid": true,
"schema_id": "content_1_0"
}
]
},
@ -60,9 +66,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contentMediaType": "application/json",
"contentEncoding": "base64"
"contentEncoding": "base64",
"$id": "content_2_0"
}
]
},
@ -70,22 +76,26 @@
{
"description": "a valid base64-encoded JSON document",
"data": "eyJmb28iOiAiYmFyIn0K",
"valid": true
"valid": true,
"schema_id": "content_2_0"
},
{
"description": "a validly-encoded invalid JSON document; validates true",
"data": "ezp9Cg==",
"valid": true
"valid": true,
"schema_id": "content_2_0"
},
{
"description": "an invalid base64 string that is valid JSON; validates true",
"data": "{}",
"valid": true
"valid": true,
"schema_id": "content_2_0"
},
{
"description": "ignores non-strings",
"data": 100,
"valid": true
"valid": true,
"schema_id": "content_2_0"
}
]
},
@ -94,7 +104,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contentMediaType": "application/json",
"contentEncoding": "base64",
"contentSchema": {
@ -110,7 +119,8 @@
"type": "integer"
}
}
}
},
"$id": "content_3_0"
}
]
},
@ -118,42 +128,50 @@
{
"description": "a valid base64-encoded JSON document",
"data": "eyJmb28iOiAiYmFyIn0K",
"valid": true
"valid": true,
"schema_id": "content_3_0"
},
{
"description": "another valid base64-encoded JSON document",
"data": "eyJib28iOiAyMCwgImZvbyI6ICJiYXoifQ==",
"valid": true
"valid": true,
"schema_id": "content_3_0"
},
{
"description": "an invalid base64-encoded JSON document; validates true",
"data": "eyJib28iOiAyMH0=",
"valid": true
"valid": true,
"schema_id": "content_3_0"
},
{
"description": "an empty object as a base64-encoded JSON document; validates true",
"data": "e30=",
"valid": true
"valid": true,
"schema_id": "content_3_0"
},
{
"description": "an empty array as a base64-encoded JSON document",
"data": "W10=",
"valid": true
"valid": true,
"schema_id": "content_3_0"
},
{
"description": "a validly-encoded invalid JSON document; validates true",
"data": "ezp9Cg==",
"valid": true
"valid": true,
"schema_id": "content_3_0"
},
{
"description": "an invalid base64 string that is valid JSON; validates true",
"data": "{}",
"valid": true
"valid": true,
"schema_id": "content_3_0"
},
{
"description": "ignores non-strings",
"data": 100,
"valid": true
"valid": true,
"schema_id": "content_3_0"
}
]
}

View File

@ -19,14 +19,16 @@
{
"description": "neither",
"data": {},
"valid": true
"valid": true,
"schema_id": "schema1"
},
{
"description": "nondependant",
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "schema1"
},
{
"description": "with dependency",
@ -34,31 +36,36 @@
"foo": 1,
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "schema1"
},
{
"description": "missing dependency",
"data": {
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "schema1"
},
{
"description": "ignores arrays",
"data": [
"bar"
],
"valid": true
"valid": true,
"schema_id": "schema1"
},
{
"description": "ignores strings",
"data": "foobar",
"valid": true
"valid": true,
"schema_id": "schema1"
},
{
"description": "ignores other non-objects",
"data": 12,
"valid": true
"valid": true,
"schema_id": "schema1"
}
]
},
@ -80,19 +87,22 @@
{
"description": "empty object",
"data": {},
"valid": true
"valid": true,
"schema_id": "schema2"
},
{
"description": "object with one property",
"data": {
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "schema2"
},
{
"description": "non-object is valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "schema2"
}
]
},
@ -117,7 +127,8 @@
{
"description": "neither",
"data": {},
"valid": true
"valid": true,
"schema_id": "schema3"
},
{
"description": "nondependants",
@ -125,7 +136,8 @@
"foo": 1,
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "schema3"
},
{
"description": "with dependencies",
@ -134,7 +146,8 @@
"bar": 2,
"quux": 3
},
"valid": true
"valid": true,
"schema_id": "schema3"
},
{
"description": "missing dependency",
@ -142,7 +155,8 @@
"foo": 1,
"quux": 2
},
"valid": false
"valid": false,
"schema_id": "schema3"
},
{
"description": "missing other dependency",
@ -150,14 +164,16 @@
"bar": 1,
"quux": 2
},
"valid": false
"valid": false,
"schema_id": "schema3"
},
{
"description": "missing both dependencies",
"data": {
"quux": 1
},
"valid": false
"valid": false,
"schema_id": "schema3"
}
]
},
@ -187,7 +203,8 @@
"foo\nbar": 1,
"foo\rbar": 2
},
"valid": true
"valid": true,
"schema_id": "schema4"
},
{
"description": "quoted quotes",
@ -195,7 +212,8 @@
"foo'bar": 1,
"foo\"bar": 2
},
"valid": true
"valid": true,
"schema_id": "schema4"
},
{
"description": "CRLF missing dependent",
@ -203,14 +221,16 @@
"foo\nbar": 1,
"foo": 2
},
"valid": false
"valid": false,
"schema_id": "schema4"
},
{
"description": "quoted quotes missing dependent",
"data": {
"foo\"bar": 2
},
"valid": false
"valid": false,
"schema_id": "schema4"
}
]
},
@ -238,7 +258,8 @@
"bar": 2,
"baz": 3
},
"valid": true
"valid": true,
"schema_id": "schema5"
}
]
},
@ -275,14 +296,16 @@
"foo": 1,
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "schema_schema1"
},
{
"description": "no dependency",
"data": {
"foo": "quux"
},
"valid": true
"valid": true,
"schema_id": "schema_schema1"
},
{
"description": "wrong type",
@ -290,7 +313,8 @@
"foo": "quux",
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "schema_schema1"
},
{
"description": "wrong type other",
@ -298,7 +322,8 @@
"foo": 2,
"bar": "quux"
},
"valid": false
"valid": false,
"schema_id": "schema_schema1"
},
{
"description": "wrong type both",
@ -306,7 +331,8 @@
"foo": "quux",
"bar": "quux"
},
"valid": false
"valid": false,
"schema_id": "schema_schema1"
},
{
"description": "ignores arrays (invalid in strict mode)",
@ -318,17 +344,20 @@
{
"code": "STRICT_ITEM_VIOLATION"
}
]
],
"schema_id": "schema_schema1"
},
{
"description": "ignores strings",
"data": "foobar",
"valid": true
"valid": true,
"schema_id": "schema_schema1"
},
{
"description": "ignores other non-objects",
"data": 12,
"valid": true
"valid": true,
"schema_id": "schema_schema1"
}
]
},
@ -365,7 +394,8 @@
"data": [
"bar"
],
"valid": true
"valid": true,
"schema_id": "schema_schema2"
}
]
},
@ -393,14 +423,16 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "schema_schema3"
},
{
"description": "object with property having schema false is invalid",
"data": {
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "schema_schema3"
},
{
"description": "object with both properties is invalid",
@ -408,12 +440,14 @@
"foo": 1,
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "schema_schema3"
},
{
"description": "empty object is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "schema_schema3"
}
]
},
@ -454,7 +488,8 @@
"b": 3,
"c": 4
},
"valid": true
"valid": true,
"schema_id": "schema_schema4"
},
{
"description": "quoted quote",
@ -463,7 +498,8 @@
"foo\"bar": 1
}
},
"valid": false
"valid": false,
"schema_id": "schema_schema4"
},
{
"description": "quoted tab invalid under dependent schema",
@ -471,14 +507,16 @@
"foo\tbar": 1,
"a": 2
},
"valid": false
"valid": false,
"schema_id": "schema_schema4"
},
{
"description": "quoted quote invalid under dependent schema",
"data": {
"foo'bar": 1
},
"valid": false
"valid": false,
"schema_id": "schema_schema4"
}
]
},
@ -509,7 +547,8 @@
"data": {
"foo": 1
},
"valid": false
"valid": false,
"schema_id": "schema_schema5"
},
{
"description": "matches dependency (invalid in strict mode - bar not allowed if foo missing)",
@ -521,7 +560,8 @@
{
"code": "STRICT_PROPERTY_VIOLATION"
}
]
],
"schema_id": "schema_schema5"
},
{
"description": "matches both",
@ -529,14 +569,16 @@
"foo": 1,
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "schema_schema5"
},
{
"description": "no dependency",
"data": {
"baz": 1
},
"valid": true
"valid": true,
"schema_id": "schema_schema5"
}
]
},
@ -569,7 +611,8 @@
"data": {
"bar": 1
},
"valid": true
"valid": true,
"schema_id": "schema_schema6"
}
]
}

View File

@ -4,7 +4,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"obj": {
"type": "object"
@ -37,7 +36,8 @@
"con_empty": {
"const": ""
}
}
},
"$id": "emptyString_0_0"
}
]
},
@ -47,56 +47,64 @@
"data": {
"obj": ""
},
"valid": true
"valid": true,
"schema_id": "emptyString_0_0"
},
{
"description": "empty string valid for array",
"data": {
"arr": ""
},
"valid": true
"valid": true,
"schema_id": "emptyString_0_0"
},
{
"description": "empty string valid for string",
"data": {
"str": ""
},
"valid": true
"valid": true,
"schema_id": "emptyString_0_0"
},
{
"description": "empty string valid for integer",
"data": {
"int": ""
},
"valid": true
"valid": true,
"schema_id": "emptyString_0_0"
},
{
"description": "empty string valid for number",
"data": {
"num": ""
},
"valid": true
"valid": true,
"schema_id": "emptyString_0_0"
},
{
"description": "empty string valid for boolean",
"data": {
"bool": ""
},
"valid": true
"valid": true,
"schema_id": "emptyString_0_0"
},
{
"description": "empty string valid for null",
"data": {
"nul": ""
},
"valid": true
"valid": true,
"schema_id": "emptyString_0_0"
},
{
"description": "empty string valid for format",
"data": {
"fmt": ""
},
"valid": true
"valid": true,
"schema_id": "emptyString_0_0"
},
{
"description": "empty string INVALID for const (unless const is empty string)",
@ -109,14 +117,16 @@
"code": "CONST_VIOLATED",
"path": "/con"
}
]
],
"schema_id": "emptyString_0_0"
},
{
"description": "empty string VALID for const if const IS empty string",
"data": {
"con_empty": ""
},
"valid": true
"valid": true,
"schema_id": "emptyString_0_0"
}
]
}

View File

@ -4,12 +4,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
1,
2,
3
]
],
"$id": "enum_0_0"
}
]
},
@ -17,12 +17,14 @@
{
"description": "one of the enum is valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "enum_0_0"
},
{
"description": "something else is invalid",
"data": 4,
"valid": false
"valid": false,
"schema_id": "enum_0_0"
}
]
},
@ -31,7 +33,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
6,
"foo",
@ -43,7 +44,8 @@
],
"properties": {
"foo": {}
}
},
"$id": "enum_1_0"
}
]
},
@ -51,26 +53,30 @@
{
"description": "one of the enum is valid",
"data": [],
"valid": true
"valid": true,
"schema_id": "enum_1_0"
},
{
"description": "something else is invalid",
"data": null,
"valid": false
"valid": false,
"schema_id": "enum_1_0"
},
{
"description": "objects are deep compared",
"data": {
"foo": false
},
"valid": false
"valid": false,
"schema_id": "enum_1_0"
},
{
"description": "valid object matches",
"data": {
"foo": 12
},
"valid": true
"valid": true,
"schema_id": "enum_1_0"
},
{
"description": "extra properties in object is invalid",
@ -78,7 +84,8 @@
"foo": 12,
"boo": 42
},
"valid": false
"valid": false,
"schema_id": "enum_1_0"
}
]
},
@ -87,11 +94,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
6,
null
]
],
"$id": "enum_2_0"
}
]
},
@ -99,17 +106,20 @@
{
"description": "null is valid",
"data": null,
"valid": true
"valid": true,
"schema_id": "enum_2_0"
},
{
"description": "number is valid",
"data": 6,
"valid": true
"valid": true,
"schema_id": "enum_2_0"
},
{
"description": "something else is invalid",
"data": "test",
"valid": false
"valid": false,
"schema_id": "enum_2_0"
}
]
},
@ -118,7 +128,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": {
@ -134,7 +143,8 @@
},
"required": [
"bar"
]
],
"$id": "enum_3_0"
}
]
},
@ -145,7 +155,8 @@
"foo": "foo",
"bar": "bar"
},
"valid": true
"valid": true,
"schema_id": "enum_3_0"
},
{
"description": "wrong foo value",
@ -153,7 +164,8 @@
"foo": "foot",
"bar": "bar"
},
"valid": false
"valid": false,
"schema_id": "enum_3_0"
},
{
"description": "wrong bar value",
@ -161,26 +173,30 @@
"foo": "foo",
"bar": "bart"
},
"valid": false
"valid": false,
"schema_id": "enum_3_0"
},
{
"description": "missing optional property is valid",
"data": {
"bar": "bar"
},
"valid": true
"valid": true,
"schema_id": "enum_3_0"
},
{
"description": "missing required property is invalid",
"data": {
"foo": "foo"
},
"valid": false
"valid": false,
"schema_id": "enum_3_0"
},
{
"description": "missing all properties is invalid",
"data": {},
"valid": false
"valid": false,
"schema_id": "enum_3_0"
}
]
},
@ -189,11 +205,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
"foo\nbar",
"foo\rbar"
]
],
"$id": "enum_4_0"
}
]
},
@ -201,17 +217,20 @@
{
"description": "member 1 is valid",
"data": "foo\nbar",
"valid": true
"valid": true,
"schema_id": "enum_4_0"
},
{
"description": "member 2 is valid",
"data": "foo\rbar",
"valid": true
"valid": true,
"schema_id": "enum_4_0"
},
{
"description": "another string is invalid",
"data": "abc",
"valid": false
"valid": false,
"schema_id": "enum_4_0"
}
]
},
@ -220,10 +239,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
false
]
],
"$id": "enum_5_0"
}
]
},
@ -231,17 +250,20 @@
{
"description": "false is valid",
"data": false,
"valid": true
"valid": true,
"schema_id": "enum_5_0"
},
{
"description": "integer zero is invalid",
"data": 0,
"valid": false
"valid": false,
"schema_id": "enum_5_0"
},
{
"description": "float zero is invalid",
"data": 0.0,
"valid": false
"data": 0,
"valid": false,
"schema_id": "enum_5_0"
}
]
},
@ -250,12 +272,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
[
false
]
]
],
"$id": "enum_6_0"
}
]
},
@ -265,21 +287,24 @@
"data": [
false
],
"valid": true
"valid": true,
"schema_id": "enum_6_0"
},
{
"description": "[0] is invalid",
"data": [
0
],
"valid": false
"valid": false,
"schema_id": "enum_6_0"
},
{
"description": "[0.0] is invalid",
"data": [
0.0
0
],
"valid": false
"valid": false,
"schema_id": "enum_6_0"
}
]
},
@ -288,10 +313,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
true
]
],
"$id": "enum_7_0"
}
]
},
@ -299,17 +324,20 @@
{
"description": "true is valid",
"data": true,
"valid": true
"valid": true,
"schema_id": "enum_7_0"
},
{
"description": "integer one is invalid",
"data": 1,
"valid": false
"valid": false,
"schema_id": "enum_7_0"
},
{
"description": "float one is invalid",
"data": 1.0,
"valid": false
"data": 1,
"valid": false,
"schema_id": "enum_7_0"
}
]
},
@ -318,12 +346,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
[
true
]
]
],
"$id": "enum_8_0"
}
]
},
@ -333,21 +361,24 @@
"data": [
true
],
"valid": true
"valid": true,
"schema_id": "enum_8_0"
},
{
"description": "[1] is invalid",
"data": [
1
],
"valid": false
"valid": false,
"schema_id": "enum_8_0"
},
{
"description": "[1.0] is invalid",
"data": [
1.0
1
],
"valid": false
"valid": false,
"schema_id": "enum_8_0"
}
]
},
@ -356,10 +387,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
0
]
],
"$id": "enum_9_0"
}
]
},
@ -367,17 +398,20 @@
{
"description": "false is invalid",
"data": false,
"valid": false
"valid": false,
"schema_id": "enum_9_0"
},
{
"description": "integer zero is valid",
"data": 0,
"valid": true
"valid": true,
"schema_id": "enum_9_0"
},
{
"description": "float zero is valid",
"data": 0.0,
"valid": true
"data": 0,
"valid": true,
"schema_id": "enum_9_0"
}
]
},
@ -386,12 +420,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
[
0
]
]
],
"$id": "enum_10_0"
}
]
},
@ -401,21 +435,24 @@
"data": [
false
],
"valid": false
"valid": false,
"schema_id": "enum_10_0"
},
{
"description": "[0] is valid",
"data": [
0
],
"valid": true
"valid": true,
"schema_id": "enum_10_0"
},
{
"description": "[0.0] is valid",
"data": [
0.0
0
],
"valid": true
"valid": true,
"schema_id": "enum_10_0"
}
]
},
@ -424,10 +461,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
1
]
],
"$id": "enum_11_0"
}
]
},
@ -435,17 +472,20 @@
{
"description": "true is invalid",
"data": true,
"valid": false
"valid": false,
"schema_id": "enum_11_0"
},
{
"description": "integer one is valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "enum_11_0"
},
{
"description": "float one is valid",
"data": 1.0,
"valid": true
"data": 1,
"valid": true,
"schema_id": "enum_11_0"
}
]
},
@ -454,12 +494,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
[
1
]
]
],
"$id": "enum_12_0"
}
]
},
@ -469,21 +509,24 @@
"data": [
true
],
"valid": false
"valid": false,
"schema_id": "enum_12_0"
},
{
"description": "[1] is valid",
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "enum_12_0"
},
{
"description": "[1.0] is valid",
"data": [
1.0
1
],
"valid": true
"valid": true,
"schema_id": "enum_12_0"
}
]
},
@ -492,10 +535,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
"hello\u0000there"
]
],
"$id": "enum_13_0"
}
]
},
@ -503,12 +546,14 @@
{
"description": "match string with nul",
"data": "hello\u0000there",
"valid": true
"valid": true,
"schema_id": "enum_13_0"
},
{
"description": "do not match string lacking nul",
"data": "hellothere",
"valid": false
"valid": false,
"schema_id": "enum_13_0"
}
]
},
@ -517,13 +562,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": [
{
"foo": 1
}
],
"extensible": true
"extensible": true,
"$id": "enum_14_0"
}
]
},
@ -534,14 +579,16 @@
"foo": 1,
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "enum_14_0"
},
{
"description": "extra property ignored during strict check, enum match succeeds",
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "enum_14_0"
}
]
}

View File

@ -4,8 +4,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"exclusiveMaximum": 3.0
"exclusiveMaximum": 3,
"$id": "exclusiveMaximum_0_0"
}
]
},
@ -13,22 +13,26 @@
{
"description": "below the exclusiveMaximum is valid",
"data": 2.2,
"valid": true
"valid": true,
"schema_id": "exclusiveMaximum_0_0"
},
{
"description": "boundary point is invalid",
"data": 3.0,
"valid": false
"data": 3,
"valid": false,
"schema_id": "exclusiveMaximum_0_0"
},
{
"description": "above the exclusiveMaximum is invalid",
"data": 3.5,
"valid": false
"valid": false,
"schema_id": "exclusiveMaximum_0_0"
},
{
"description": "ignores non-numbers",
"data": "x",
"valid": true
"valid": true,
"schema_id": "exclusiveMaximum_0_0"
}
]
}

View File

@ -4,8 +4,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"exclusiveMinimum": 1.1
"exclusiveMinimum": 1.1,
"$id": "exclusiveMinimum_0_0"
}
]
},
@ -13,22 +13,26 @@
{
"description": "above the exclusiveMinimum is valid",
"data": 1.2,
"valid": true
"valid": true,
"schema_id": "exclusiveMinimum_0_0"
},
{
"description": "boundary point is invalid",
"data": 1.1,
"valid": false
"valid": false,
"schema_id": "exclusiveMinimum_0_0"
},
{
"description": "below the exclusiveMinimum is invalid",
"data": 0.6,
"valid": false
"valid": false,
"schema_id": "exclusiveMinimum_0_0"
},
{
"description": "ignores non-numbers",
"data": "x",
"valid": true
"valid": true,
"schema_id": "exclusiveMinimum_0_0"
}
]
}

View File

@ -1,6 +1,6 @@
[
{
"description": "Entity families with dot patterns",
"description": "Entity families via pure $ref graph",
"database": {
"types": [
{
@ -17,8 +17,7 @@
"type": "string"
},
"type": {
"type": "string",
"const": "entity"
"type": "string"
}
}
},
@ -65,7 +64,7 @@
},
{
"$id": "person.light",
"$ref": "person"
"$ref": "entity.light"
}
]
}
@ -113,7 +112,7 @@
"valid": true
},
{
"description": "Dot pattern family matches entity.light",
"description": "Graph family matches entity.light",
"schema_id": "get_light_entities.response",
"data": {
"id": "3",
@ -122,25 +121,29 @@
"valid": true
},
{
"description": "Dot pattern family matches person.light",
"description": "Graph family matches person.light (because it $refs entity.light)",
"schema_id": "get_light_entities.response",
"data": {
"id": "4",
"type": "person",
"name": "ACME",
"first_name": "John"
"type": "person"
},
"valid": true
},
{
"description": "Dot pattern family excludes organization (missing .light schema, constraint violation)",
"description": "Graph family excludes organization (missing .light schema that $refs entity.light)",
"schema_id": "get_light_entities.response",
"data": {
"id": "5",
"type": "organization",
"name": "ACME"
},
"valid": false
"valid": false,
"expect_errors": [
{
"code": "FAMILY_MISMATCH",
"path": ""
}
]
}
]
},
@ -182,20 +185,14 @@
},
"tests": [
{
"description": "Ad-hoc family does not implicitly match descendants (no magical implicit hierarchy on normal ad-hoc schemas)",
"description": "Ad-hoc family matches strictly by shape (no magic variations for base schemas)",
"schema_id": "get_widgets.response",
"data": {
"id": "1",
"widget_type": "special",
"special_feature": "yes"
},
"valid": false,
"expect_errors": [
{
"code": "FAMILY_MISMATCH",
"path": ""
}
]
"valid": true
}
]
}

File diff suppressed because it is too large Load Diff

View File

@ -4,10 +4,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"if": {
"const": 0
}
},
"$id": "if-then-else_0_0"
}
]
},
@ -15,12 +15,14 @@
{
"description": "valid when valid against lone if",
"data": 0,
"valid": true
"valid": true,
"schema_id": "if-then-else_0_0"
},
{
"description": "valid when invalid against lone if",
"data": "hello",
"valid": true
"valid": true,
"schema_id": "if-then-else_0_0"
}
]
},
@ -29,10 +31,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"then": {
"const": 0
}
},
"$id": "if-then-else_1_0"
}
]
},
@ -40,12 +42,14 @@
{
"description": "valid when valid against lone then",
"data": 0,
"valid": true
"valid": true,
"schema_id": "if-then-else_1_0"
},
{
"description": "valid when invalid against lone then",
"data": "hello",
"valid": true
"valid": true,
"schema_id": "if-then-else_1_0"
}
]
},
@ -54,10 +58,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"else": {
"const": 0
}
},
"$id": "if-then-else_2_0"
}
]
},
@ -65,12 +69,14 @@
{
"description": "valid when valid against lone else",
"data": 0,
"valid": true
"valid": true,
"schema_id": "if-then-else_2_0"
},
{
"description": "valid when invalid against lone else",
"data": "hello",
"valid": true
"valid": true,
"schema_id": "if-then-else_2_0"
}
]
},
@ -79,13 +85,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"if": {
"exclusiveMaximum": 0
},
"then": {
"minimum": -10
}
},
"$id": "if-then-else_3_0"
}
]
},
@ -93,17 +99,20 @@
{
"description": "valid through then",
"data": -1,
"valid": true
"valid": true,
"schema_id": "if-then-else_3_0"
},
{
"description": "invalid through then",
"data": -100,
"valid": false
"valid": false,
"schema_id": "if-then-else_3_0"
},
{
"description": "valid when if test fails",
"data": 3,
"valid": true
"valid": true,
"schema_id": "if-then-else_3_0"
}
]
},
@ -112,13 +121,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"if": {
"exclusiveMaximum": 0
},
"else": {
"multipleOf": 2
}
},
"$id": "if-then-else_4_0"
}
]
},
@ -126,17 +135,20 @@
{
"description": "valid when if test passes",
"data": -1,
"valid": true
"valid": true,
"schema_id": "if-then-else_4_0"
},
{
"description": "valid through else",
"data": 4,
"valid": true
"valid": true,
"schema_id": "if-then-else_4_0"
},
{
"description": "invalid through else",
"data": 3,
"valid": false
"valid": false,
"schema_id": "if-then-else_4_0"
}
]
},
@ -145,7 +157,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"if": {
"exclusiveMaximum": 0
},
@ -154,7 +165,8 @@
},
"else": {
"multipleOf": 2
}
},
"$id": "if-then-else_5_0"
}
]
},
@ -162,22 +174,26 @@
{
"description": "valid through then",
"data": -1,
"valid": true
"valid": true,
"schema_id": "if-then-else_5_0"
},
{
"description": "invalid through then",
"data": -100,
"valid": false
"valid": false,
"schema_id": "if-then-else_5_0"
},
{
"description": "valid through else",
"data": 4,
"valid": true
"valid": true,
"schema_id": "if-then-else_5_0"
},
{
"description": "invalid through else",
"data": 3,
"valid": false
"valid": false,
"schema_id": "if-then-else_5_0"
}
]
},
@ -186,7 +202,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"if": {
@ -203,7 +218,8 @@
"multipleOf": 2
}
}
]
],
"$id": "if-then-else_6_0"
}
]
},
@ -211,12 +227,14 @@
{
"description": "valid, but would have been invalid through then",
"data": -100,
"valid": true
"valid": true,
"schema_id": "if-then-else_6_0"
},
{
"description": "valid, but would have been invalid through else",
"data": 3,
"valid": true
"valid": true,
"schema_id": "if-then-else_6_0"
}
]
},
@ -225,14 +243,14 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"if": true,
"then": {
"const": "then"
},
"else": {
"const": "else"
}
},
"$id": "if-then-else_7_0"
}
]
},
@ -240,12 +258,14 @@
{
"description": "boolean schema true in if always chooses the then path (valid)",
"data": "then",
"valid": true
"valid": true,
"schema_id": "if-then-else_7_0"
},
{
"description": "boolean schema true in if always chooses the then path (invalid)",
"data": "else",
"valid": false
"valid": false,
"schema_id": "if-then-else_7_0"
}
]
},
@ -254,14 +274,14 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"if": false,
"then": {
"const": "then"
},
"else": {
"const": "else"
}
},
"$id": "if-then-else_8_0"
}
]
},
@ -269,12 +289,14 @@
{
"description": "boolean schema false in if always chooses the else path (invalid)",
"data": "then",
"valid": false
"valid": false,
"schema_id": "if-then-else_8_0"
},
{
"description": "boolean schema false in if always chooses the else path (valid)",
"data": "else",
"valid": true
"valid": true,
"schema_id": "if-then-else_8_0"
}
]
},
@ -283,7 +305,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"then": {
"const": "yes"
},
@ -292,7 +313,8 @@
},
"if": {
"maxLength": 4
}
},
"$id": "if-then-else_9_0"
}
]
},
@ -300,22 +322,26 @@
{
"description": "yes redirects to then and passes",
"data": "yes",
"valid": true
"valid": true,
"schema_id": "if-then-else_9_0"
},
{
"description": "other redirects to else and passes",
"data": "other",
"valid": true
"valid": true,
"schema_id": "if-then-else_9_0"
},
{
"description": "no redirects to then and fails",
"data": "no",
"valid": false
"valid": false,
"schema_id": "if-then-else_9_0"
},
{
"description": "invalid redirects to else and fails",
"data": "invalid",
"valid": false
"valid": false,
"schema_id": "if-then-else_9_0"
}
]
},
@ -327,7 +353,8 @@
"if": {
"const": 1
},
"then": false
"then": false,
"$id": "if-then-else_10_0"
}
]
},
@ -335,12 +362,14 @@
{
"description": "matches if → then=false → invalid",
"data": 1,
"valid": false
"valid": false,
"schema_id": "if-then-else_10_0"
},
{
"description": "does not match if → then ignored → valid",
"data": 2,
"valid": true
"valid": true,
"schema_id": "if-then-else_10_0"
}
]
},
@ -352,7 +381,8 @@
"if": {
"const": 1
},
"else": false
"else": false,
"$id": "if-then-else_11_0"
}
]
},
@ -360,12 +390,14 @@
{
"description": "matches if → else ignored → valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "if-then-else_11_0"
},
{
"description": "does not match if → else executes → invalid",
"data": 2,
"valid": false
"valid": false,
"schema_id": "if-then-else_11_0"
}
]
},
@ -374,7 +406,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"if": {
"properties": {
"foo": {
@ -395,7 +426,8 @@
"bar"
]
},
"extensible": true
"extensible": true,
"$id": "if-then-else_12_0"
}
]
},
@ -407,7 +439,8 @@
"bar": 2,
"extra": "prop"
},
"valid": true
"valid": true,
"schema_id": "if-then-else_12_0"
}
]
},
@ -416,7 +449,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"if": {
"properties": {
"foo": {
@ -433,7 +465,8 @@
"const": 2
}
}
}
},
"$id": "if-then-else_13_0"
}
]
},
@ -444,7 +477,8 @@
"foo": 1,
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "if-then-else_13_0"
},
{
"description": "fails on extra property z explicitly",
@ -453,7 +487,8 @@
"bar": 2,
"z": 3
},
"valid": false
"valid": false,
"schema_id": "if-then-else_13_0"
}
]
}

View File

@ -4,10 +4,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"items": {
"type": "integer"
}
},
"$id": "items_0_0"
}
]
},
@ -19,7 +19,8 @@
2,
3
],
"valid": true
"valid": true,
"schema_id": "items_0_0"
},
{
"description": "wrong type of items",
@ -27,14 +28,16 @@
1,
"x"
],
"valid": false
"valid": false,
"schema_id": "items_0_0"
},
{
"description": "non-arrays are invalid",
"data": {
"foo": "bar"
},
"valid": false
"valid": false,
"schema_id": "items_0_0"
},
{
"description": "JavaScript pseudo-arrays are invalid",
@ -42,7 +45,8 @@
"0": "invalid",
"length": 1
},
"valid": false
"valid": false,
"schema_id": "items_0_0"
}
]
},
@ -51,8 +55,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"items": true
"items": true,
"$id": "items_1_0"
}
]
},
@ -64,12 +68,14 @@
"foo",
true
],
"valid": true
"valid": true,
"schema_id": "items_1_0"
},
{
"description": "empty array is valid",
"data": [],
"valid": true
"valid": true,
"schema_id": "items_1_0"
}
]
},
@ -78,8 +84,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"items": false
"items": false,
"$id": "items_2_0"
}
]
},
@ -91,12 +97,14 @@
"foo",
true
],
"valid": false
"valid": false,
"schema_id": "items_2_0"
},
{
"description": "empty array is valid",
"data": [],
"valid": true
"valid": true,
"schema_id": "items_2_0"
}
]
},
@ -105,39 +113,39 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"item": {
"type": "array",
"items": false,
"prefixItems": [
{
"$ref": "#/$defs/sub-item"
},
{
"$ref": "#/$defs/sub-item"
}
]
},
"sub-item": {
"type": "object",
"required": [
"foo"
]
}
},
"type": "array",
"items": false,
"prefixItems": [
{
"$ref": "#/$defs/item"
"$ref": "item"
},
{
"$ref": "#/$defs/item"
"$ref": "item"
},
{
"$ref": "#/$defs/item"
"$ref": "item"
}
],
"$id": "items_3_0"
},
{
"$id": "item",
"type": "array",
"items": false,
"prefixItems": [
{
"$ref": "sub-item"
},
{
"$ref": "sub-item"
}
]
},
{
"$id": "sub-item",
"type": "object",
"required": [
"foo"
]
}
]
@ -171,7 +179,8 @@
}
]
],
"valid": false
"valid": false,
"schema_id": "items_3_0"
},
{
"description": "too many items",
@ -209,7 +218,8 @@
}
]
],
"valid": false
"valid": false,
"schema_id": "items_3_0"
},
{
"description": "too many sub-items",
@ -242,7 +252,8 @@
}
]
],
"valid": false
"valid": false,
"schema_id": "items_3_0"
},
{
"description": "wrong item",
@ -267,7 +278,8 @@
}
]
],
"valid": false
"valid": false,
"schema_id": "items_3_0"
},
{
"description": "wrong sub-item",
@ -295,7 +307,8 @@
}
]
],
"valid": false
"valid": false,
"schema_id": "items_3_0"
},
{
"description": "fewer items is invalid",
@ -311,7 +324,8 @@
}
]
],
"valid": false
"valid": false,
"schema_id": "items_3_0"
}
]
},
@ -320,7 +334,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "array",
"items": {
"type": "array",
@ -333,7 +346,8 @@
}
}
}
}
},
"$id": "items_4_0"
}
]
},
@ -370,7 +384,8 @@
]
]
],
"valid": true
"valid": true,
"schema_id": "items_4_0"
},
{
"description": "nested array with invalid type",
@ -404,7 +419,8 @@
]
]
],
"valid": false
"valid": false,
"schema_id": "items_4_0"
},
{
"description": "not deep enough",
@ -432,7 +448,8 @@
]
]
],
"valid": false
"valid": false,
"schema_id": "items_4_0"
}
]
},
@ -441,13 +458,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{},
{},
{}
],
"items": false
"items": false,
"$id": "items_5_0"
}
]
},
@ -455,14 +472,16 @@
{
"description": "empty array",
"data": [],
"valid": true
"valid": true,
"schema_id": "items_5_0"
},
{
"description": "fewer number of items present (1)",
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "items_5_0"
},
{
"description": "fewer number of items present (2)",
@ -470,7 +489,8 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "items_5_0"
},
{
"description": "equal number of items present",
@ -479,7 +499,8 @@
2,
3
],
"valid": true
"valid": true,
"schema_id": "items_5_0"
},
{
"description": "additional items are not permitted",
@ -489,7 +510,8 @@
3,
4
],
"valid": false
"valid": false,
"schema_id": "items_5_0"
}
]
},
@ -498,7 +520,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"prefixItems": [
@ -510,7 +531,8 @@
],
"items": {
"minimum": 5
}
},
"$id": "items_6_0"
}
]
},
@ -521,7 +543,8 @@
3,
5
],
"valid": false
"valid": false,
"schema_id": "items_6_0"
},
{
"description": "prefixItems in allOf does not constrain items, valid case",
@ -529,7 +552,8 @@
5,
5
],
"valid": true
"valid": true,
"schema_id": "items_6_0"
}
]
},
@ -538,7 +562,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{
"type": "string"
@ -546,7 +569,8 @@
],
"items": {
"type": "integer"
}
},
"$id": "items_7_0"
}
]
},
@ -558,7 +582,8 @@
2,
3
],
"valid": true
"valid": true,
"schema_id": "items_7_0"
},
{
"description": "wrong type of second item",
@ -566,7 +591,8 @@
"x",
"y"
],
"valid": false
"valid": false,
"schema_id": "items_7_0"
}
]
},
@ -575,11 +601,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{}
],
"items": false
"items": false,
"$id": "items_8_0"
}
]
},
@ -591,14 +617,16 @@
"bar",
37
],
"valid": false
"valid": false,
"schema_id": "items_8_0"
},
{
"description": "valid instance",
"data": [
null
],
"valid": true
"valid": true,
"schema_id": "items_8_0"
}
]
},
@ -607,10 +635,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"items": {
"type": "null"
}
},
"$id": "items_9_0"
}
]
},
@ -620,7 +648,8 @@
"data": [
null
],
"valid": true
"valid": true,
"schema_id": "items_9_0"
}
]
},
@ -629,9 +658,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"items": false,
"extensible": true
"extensible": true,
"$id": "items_10_0"
}
]
},
@ -641,7 +670,8 @@
"data": [
1
],
"valid": false
"valid": false,
"schema_id": "items_10_0"
}
]
},
@ -650,11 +680,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"items": {
"minimum": 5
},
"extensible": true
"extensible": true,
"$id": "items_11_0"
}
]
},
@ -665,14 +695,16 @@
5,
6
],
"valid": true
"valid": true,
"schema_id": "items_11_0"
},
{
"description": "invalid item (less than min) is invalid even with extensible: true",
"data": [
4
],
"valid": false
"valid": false,
"schema_id": "items_11_0"
}
]
},
@ -681,9 +713,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "array",
"extensible": true
"extensible": true,
"$id": "items_12_0"
}
]
},
@ -691,7 +723,8 @@
{
"description": "empty array is valid",
"data": [],
"valid": true
"valid": true,
"schema_id": "items_12_0"
},
{
"description": "array with items is valid (extensible)",
@ -699,7 +732,8 @@
1,
"foo"
],
"valid": true
"valid": true,
"schema_id": "items_12_0"
}
]
},
@ -708,9 +742,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "array",
"extensible": false
"extensible": false,
"$id": "items_13_0"
}
]
},
@ -718,14 +752,16 @@
{
"description": "empty array is valid",
"data": [],
"valid": true
"valid": true,
"schema_id": "items_13_0"
},
{
"description": "array with items is invalid (strict)",
"data": [
1
],
"valid": false
"valid": false,
"schema_id": "items_13_0"
}
]
},
@ -734,11 +770,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "array",
"items": {
"extensible": true
}
},
"$id": "items_14_0"
}
]
},
@ -746,7 +782,8 @@
{
"description": "empty array is valid",
"data": [],
"valid": true
"valid": true,
"schema_id": "items_14_0"
},
{
"description": "array with items is valid (items explicitly allowed to be anything extensible)",
@ -755,7 +792,8 @@
"foo",
{}
],
"valid": true
"valid": true,
"schema_id": "items_14_0"
}
]
},
@ -764,12 +802,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "array",
"items": {
"type": "object",
"extensible": false
}
},
"$id": "items_15_0"
}
]
},
@ -779,14 +817,16 @@
"data": [
{}
],
"valid": true
"valid": true,
"schema_id": "items_15_0"
},
{
"description": "array with strict object items is valid",
"data": [
{}
],
"valid": true
"valid": true,
"schema_id": "items_15_0"
},
{
"description": "array with invalid strict object items (extra property)",
@ -795,7 +835,8 @@
"extra": 1
}
],
"valid": false
"valid": false,
"schema_id": "items_15_0"
}
]
}

View File

@ -1,187 +0,0 @@
[
{
"description": "Masking Properties",
"database": {
"schemas": [
{
"$id": "mask_properties",
"type": "object",
"properties": {
"foo": {
"type": "string"
},
"bar": {
"type": "integer"
}
},
"required": [
"foo"
],
"extensible": false
}
]
},
"tests": [
{
"description": "Keep valid properties",
"data": {
"foo": "a",
"bar": 1
},
"valid": true,
"expected": {
"foo": "a",
"bar": 1
}
},
{
"description": "Remove unknown properties",
"data": {
"foo": "a",
"baz": true
},
"valid": true,
"expected": {
"foo": "a"
}
},
{
"description": "Keep valid properties with unknown",
"data": {
"foo": "a",
"bar": 1,
"baz": true
},
"valid": true,
"expected": {
"foo": "a",
"bar": 1
}
}
]
},
{
"description": "Masking Nested Objects",
"database": {
"schemas": [
{
"$id": "mask_nested",
"type": "object",
"properties": {
"meta": {
"type": "object",
"properties": {
"id": {
"type": "integer"
}
},
"extensible": false
}
},
"extensible": false
}
]
},
"tests": [
{
"description": "Mask nested object",
"data": {
"meta": {
"id": 1,
"extra": "x"
},
"top_extra": "y"
},
"valid": true,
"expected": {
"meta": {
"id": 1
}
}
}
]
},
{
"description": "Masking Arrays",
"database": {
"schemas": [
{
"$id": "mask_arrays",
"type": "object",
"properties": {
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"extensible": false
}
]
},
"tests": [
{
"description": "Arrays are kept (items are valid)",
"data": {
"tags": [
"a",
"b"
]
},
"valid": true,
"expected": {
"tags": [
"a",
"b"
]
}
}
]
},
{
"description": "Masking Tuple Arrays (prefixItems)",
"database": {
"schemas": [
{
"$id": "mask_tuple",
"type": "object",
"properties": {
"coord": {
"type": "array",
"prefixItems": [
{
"type": "number"
},
{
"type": "number"
}
]
}
},
"extensible": false
}
]
},
"tests": [
{
"description": "Extra tuple items removed",
"data": {
"coord": [
1,
2,
3,
"extra"
]
},
"valid": true,
"expected": {
"coord": [
1,
2
]
}
}
]
}
]

View File

@ -4,9 +4,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"maxContains": 1,
"extensible": true
"extensible": true,
"$id": "maxContains_0_0"
}
]
},
@ -16,7 +16,8 @@
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "maxContains_0_0"
},
{
"description": "two items still valid against lone maxContains",
@ -24,7 +25,8 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "maxContains_0_0"
}
]
},
@ -33,12 +35,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"maxContains": 1,
"extensible": true
"extensible": true,
"$id": "maxContains_1_0"
}
]
},
@ -46,14 +48,16 @@
{
"description": "empty data",
"data": [],
"valid": false
"valid": false,
"schema_id": "maxContains_1_0"
},
{
"description": "all elements match, valid maxContains",
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "maxContains_1_0"
},
{
"description": "all elements match, invalid maxContains",
@ -61,7 +65,8 @@
1,
1
],
"valid": false
"valid": false,
"schema_id": "maxContains_1_0"
},
{
"description": "some elements match, valid maxContains",
@ -69,7 +74,8 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "maxContains_1_0"
},
{
"description": "some elements match, invalid maxContains",
@ -78,7 +84,8 @@
2,
1
],
"valid": false
"valid": false,
"schema_id": "maxContains_1_0"
}
]
},
@ -87,12 +94,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"maxContains": 1.0,
"extensible": true
"maxContains": 1,
"extensible": true,
"$id": "maxContains_2_0"
}
]
},
@ -102,7 +109,8 @@
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "maxContains_2_0"
},
{
"description": "too many elements match, invalid maxContains",
@ -110,7 +118,8 @@
1,
1
],
"valid": false
"valid": false,
"schema_id": "maxContains_2_0"
}
]
},
@ -119,13 +128,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"minContains": 1,
"maxContains": 3,
"extensible": true
"extensible": true,
"$id": "maxContains_3_0"
}
]
},
@ -133,7 +142,8 @@
{
"description": "actual < minContains < maxContains",
"data": [],
"valid": false
"valid": false,
"schema_id": "maxContains_3_0"
},
{
"description": "minContains < actual < maxContains",
@ -141,7 +151,8 @@
1,
1
],
"valid": true
"valid": true,
"schema_id": "maxContains_3_0"
},
{
"description": "minContains < maxContains < actual",
@ -151,7 +162,8 @@
1,
1
],
"valid": false
"valid": false,
"schema_id": "maxContains_3_0"
}
]
},
@ -160,12 +172,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"maxContains": 1,
"extensible": true
"extensible": true,
"$id": "maxContains_4_0"
}
]
},
@ -176,7 +188,8 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "maxContains_4_0"
}
]
}

View File

@ -4,9 +4,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"maxItems": 2,
"extensible": true
"extensible": true,
"$id": "maxItems_0_0"
}
]
},
@ -16,7 +16,8 @@
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "maxItems_0_0"
},
{
"description": "exact length is valid",
@ -24,7 +25,8 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "maxItems_0_0"
},
{
"description": "too long is invalid",
@ -33,12 +35,14 @@
2,
3
],
"valid": false
"valid": false,
"schema_id": "maxItems_0_0"
},
{
"description": "ignores non-arrays",
"data": "foobar",
"valid": true
"valid": true,
"schema_id": "maxItems_0_0"
}
]
},
@ -47,9 +51,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"maxItems": 2.0,
"extensible": true
"maxItems": 2,
"extensible": true,
"$id": "maxItems_1_0"
}
]
},
@ -59,7 +63,8 @@
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "maxItems_1_0"
},
{
"description": "too long is invalid",
@ -68,7 +73,8 @@
2,
3
],
"valid": false
"valid": false,
"schema_id": "maxItems_1_0"
}
]
},
@ -77,9 +83,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"maxItems": 2,
"extensible": true
"extensible": true,
"$id": "maxItems_2_0"
}
]
},
@ -91,7 +97,8 @@
2,
3
],
"valid": false
"valid": false,
"schema_id": "maxItems_2_0"
}
]
}

View File

@ -4,8 +4,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"maxLength": 2
"maxLength": 2,
"$id": "maxLength_0_0"
}
]
},
@ -13,27 +13,32 @@
{
"description": "shorter is valid",
"data": "f",
"valid": true
"valid": true,
"schema_id": "maxLength_0_0"
},
{
"description": "exact length is valid",
"data": "fo",
"valid": true
"valid": true,
"schema_id": "maxLength_0_0"
},
{
"description": "too long is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "maxLength_0_0"
},
{
"description": "ignores non-strings",
"data": 100,
"valid": true
"valid": true,
"schema_id": "maxLength_0_0"
},
{
"description": "two graphemes is long enough",
"data": "\uD83D\uDCA9\uD83D\uDCA9",
"valid": true
"data": "💩💩",
"valid": true,
"schema_id": "maxLength_0_0"
}
]
},
@ -42,8 +47,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"maxLength": 2.0
"maxLength": 2,
"$id": "maxLength_1_0"
}
]
},
@ -51,12 +56,14 @@
{
"description": "shorter is valid",
"data": "f",
"valid": true
"valid": true,
"schema_id": "maxLength_1_0"
},
{
"description": "too long is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "maxLength_1_0"
}
]
}

View File

@ -4,9 +4,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"maxProperties": 2,
"extensible": true
"extensible": true,
"$id": "maxProperties_0_0"
}
]
},
@ -16,7 +16,8 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "maxProperties_0_0"
},
{
"description": "exact length is valid",
@ -24,7 +25,8 @@
"foo": 1,
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "maxProperties_0_0"
},
{
"description": "too long is invalid",
@ -33,7 +35,8 @@
"bar": 2,
"baz": 3
},
"valid": false
"valid": false,
"schema_id": "maxProperties_0_0"
},
{
"description": "ignores arrays",
@ -42,17 +45,20 @@
2,
3
],
"valid": true
"valid": true,
"schema_id": "maxProperties_0_0"
},
{
"description": "ignores strings",
"data": "foobar",
"valid": true
"valid": true,
"schema_id": "maxProperties_0_0"
},
{
"description": "ignores other non-objects",
"data": 12,
"valid": true
"valid": true,
"schema_id": "maxProperties_0_0"
}
]
},
@ -61,9 +67,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"maxProperties": 2.0,
"extensible": true
"maxProperties": 2,
"extensible": true,
"$id": "maxProperties_1_0"
}
]
},
@ -73,7 +79,8 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "maxProperties_1_0"
},
{
"description": "too long is invalid",
@ -82,7 +89,8 @@
"bar": 2,
"baz": 3
},
"valid": false
"valid": false,
"schema_id": "maxProperties_1_0"
}
]
},
@ -91,9 +99,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"maxProperties": 0,
"extensible": true
"extensible": true,
"$id": "maxProperties_2_0"
}
]
},
@ -101,14 +109,16 @@
{
"description": "no properties is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "maxProperties_2_0"
},
{
"description": "one property is invalid",
"data": {
"foo": 1
},
"valid": false
"valid": false,
"schema_id": "maxProperties_2_0"
}
]
},
@ -117,9 +127,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"maxProperties": 2,
"extensible": true
"extensible": true,
"$id": "maxProperties_3_0"
}
]
},
@ -131,14 +141,16 @@
"bar": 2,
"baz": 3
},
"valid": false
"valid": false,
"schema_id": "maxProperties_3_0"
},
{
"description": "extra property is valid if below maxProperties",
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "maxProperties_3_0"
}
]
}

View File

@ -4,8 +4,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"maximum": 3.0
"maximum": 3,
"$id": "maximum_0_0"
}
]
},
@ -13,22 +13,26 @@
{
"description": "below the maximum is valid",
"data": 2.6,
"valid": true
"valid": true,
"schema_id": "maximum_0_0"
},
{
"description": "boundary point is valid",
"data": 3.0,
"valid": true
"data": 3,
"valid": true,
"schema_id": "maximum_0_0"
},
{
"description": "above the maximum is invalid",
"data": 3.5,
"valid": false
"valid": false,
"schema_id": "maximum_0_0"
},
{
"description": "ignores non-numbers",
"data": "x",
"valid": true
"valid": true,
"schema_id": "maximum_0_0"
}
]
},
@ -37,8 +41,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"maximum": 300
"maximum": 300,
"$id": "maximum_1_0"
}
]
},
@ -46,22 +50,26 @@
{
"description": "below the maximum is invalid",
"data": 299.97,
"valid": true
"valid": true,
"schema_id": "maximum_1_0"
},
{
"description": "boundary point integer is valid",
"data": 300,
"valid": true
"valid": true,
"schema_id": "maximum_1_0"
},
{
"description": "boundary point float is valid",
"data": 300.00,
"valid": true
"data": 300,
"valid": true,
"schema_id": "maximum_1_0"
},
{
"description": "above the maximum is invalid",
"data": 300.5,
"valid": false
"valid": false,
"schema_id": "maximum_1_0"
}
]
}

View File

@ -4,22 +4,21 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"base": {
"properties": {
"base_prop": {
"type": "string"
}
}
"$id": "base_0",
"properties": {
"base_prop": {
"type": "string"
}
},
"$ref": "#/$defs/base",
}
},
{
"$ref": "base_0",
"properties": {
"child_prop": {
"type": "string"
}
}
},
"$id": "merge_0_0"
}
]
},
@ -30,7 +29,8 @@
"base_prop": "a",
"child_prop": "b"
},
"valid": true
"valid": true,
"schema_id": "merge_0_0"
},
{
"description": "invalid when base property has wrong type",
@ -44,7 +44,8 @@
"code": "TYPE_MISMATCH",
"path": "/base_prop"
}
]
],
"schema_id": "merge_0_0"
}
]
},
@ -53,20 +54,18 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"base": {
"properties": {
"a": {
"type": "string"
}
},
"required": [
"a"
]
"$id": "base_1",
"properties": {
"a": {
"type": "string"
}
},
"$ref": "#/$defs/base",
"required": [
"a"
]
},
{
"$ref": "base_1",
"properties": {
"b": {
"type": "string"
@ -74,7 +73,8 @@
},
"required": [
"b"
]
],
"$id": "merge_1_0"
}
]
},
@ -85,7 +85,8 @@
"a": "ok",
"b": "ok"
},
"valid": true
"valid": true,
"schema_id": "merge_1_0"
},
{
"description": "invalid when base required missing",
@ -98,7 +99,8 @@
"code": "REQUIRED_FIELD_MISSING",
"path": "/a"
}
]
],
"schema_id": "merge_1_0"
},
{
"description": "invalid when child required missing",
@ -111,7 +113,8 @@
"code": "REQUIRED_FIELD_MISSING",
"path": "/b"
}
]
],
"schema_id": "merge_1_0"
}
]
},
@ -120,25 +123,23 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"base": {
"properties": {
"trigger": {
"type": "string"
},
"base_dep": {
"type": "string"
}
},
"dependencies": {
"trigger": [
"base_dep"
]
}
"$id": "base_2",
"properties": {
"trigger": {
"type": "string"
},
"base_dep": {
"type": "string"
}
},
"$ref": "#/$defs/base",
"dependencies": {
"trigger": [
"base_dep"
]
}
},
{
"$ref": "base_2",
"properties": {
"child_dep": {
"type": "string"
@ -148,7 +149,8 @@
"trigger": [
"child_dep"
]
}
},
"$id": "merge_2_0"
}
]
},
@ -160,7 +162,8 @@
"base_dep": "ok",
"child_dep": "ok"
},
"valid": true
"valid": true,
"schema_id": "merge_2_0"
},
{
"description": "invalid missing base dep",
@ -174,7 +177,8 @@
"code": "DEPENDENCY_FAILED",
"path": "/base_dep"
}
]
],
"schema_id": "merge_2_0"
},
{
"description": "invalid missing child dep",
@ -188,7 +192,8 @@
"code": "DEPENDENCY_FAILED",
"path": "/child_dep"
}
]
],
"schema_id": "merge_2_0"
}
]
},
@ -197,24 +202,22 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"base": {
"properties": {
"a": {
"type": "string"
},
"b": {
"type": "string"
}
},
"form": [
"a",
"b"
]
"$id": "base_3",
"properties": {
"a": {
"type": "string"
},
"b": {
"type": "string"
}
},
"$ref": "#/$defs/base",
"form": [
"a",
"b"
]
},
{
"$ref": "base_3",
"properties": {
"c": {
"type": "string"
@ -222,7 +225,8 @@
},
"form": [
"c"
]
],
"$id": "merge_3_0"
}
]
},
@ -235,7 +239,8 @@
"c": "ok"
},
"valid": true,
"comment": "Verifies validator handles the unmerged metadata correctly (ignores it or handles replacement)"
"comment": "Verifies validator handles the unmerged metadata correctly (ignores it or handles replacement)",
"schema_id": "merge_3_0"
}
]
}

View File

@ -4,9 +4,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minContains": 1,
"extensible": true
"extensible": true,
"$id": "minContains_0_0"
}
]
},
@ -16,12 +16,14 @@
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "minContains_0_0"
},
{
"description": "zero items still valid against lone minContains",
"data": [],
"valid": true
"valid": true,
"schema_id": "minContains_0_0"
}
]
},
@ -30,12 +32,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"minContains": 1,
"extensible": true
"extensible": true,
"$id": "minContains_1_0"
}
]
},
@ -43,21 +45,24 @@
{
"description": "empty data",
"data": [],
"valid": false
"valid": false,
"schema_id": "minContains_1_0"
},
{
"description": "no elements match",
"data": [
2
],
"valid": false
"valid": false,
"schema_id": "minContains_1_0"
},
{
"description": "single element matches, valid minContains",
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "minContains_1_0"
},
{
"description": "some elements match, valid minContains",
@ -65,7 +70,8 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "minContains_1_0"
},
{
"description": "all elements match, valid minContains",
@ -73,7 +79,8 @@
1,
1
],
"valid": true
"valid": true,
"schema_id": "minContains_1_0"
}
]
},
@ -82,12 +89,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"minContains": 2,
"extensible": true
"extensible": true,
"$id": "minContains_2_0"
}
]
},
@ -95,14 +102,16 @@
{
"description": "empty data",
"data": [],
"valid": false
"valid": false,
"schema_id": "minContains_2_0"
},
{
"description": "all elements match, invalid minContains",
"data": [
1
],
"valid": false
"valid": false,
"schema_id": "minContains_2_0"
},
{
"description": "some elements match, invalid minContains",
@ -110,7 +119,8 @@
1,
2
],
"valid": false
"valid": false,
"schema_id": "minContains_2_0"
},
{
"description": "all elements match, valid minContains (exactly as needed)",
@ -118,7 +128,8 @@
1,
1
],
"valid": true
"valid": true,
"schema_id": "minContains_2_0"
},
{
"description": "all elements match, valid minContains (more than needed)",
@ -127,7 +138,8 @@
1,
1
],
"valid": true
"valid": true,
"schema_id": "minContains_2_0"
},
{
"description": "some elements match, valid minContains",
@ -136,7 +148,8 @@
2,
1
],
"valid": true
"valid": true,
"schema_id": "minContains_2_0"
}
]
},
@ -145,12 +158,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"minContains": 2.0,
"extensible": true
"minContains": 2,
"extensible": true,
"$id": "minContains_3_0"
}
]
},
@ -160,7 +173,8 @@
"data": [
1
],
"valid": false
"valid": false,
"schema_id": "minContains_3_0"
},
{
"description": "both elements match, valid minContains",
@ -168,7 +182,8 @@
1,
1
],
"valid": true
"valid": true,
"schema_id": "minContains_3_0"
}
]
},
@ -177,13 +192,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"maxContains": 2,
"minContains": 2,
"extensible": true
"extensible": true,
"$id": "minContains_4_0"
}
]
},
@ -191,14 +206,16 @@
{
"description": "empty data",
"data": [],
"valid": false
"valid": false,
"schema_id": "minContains_4_0"
},
{
"description": "all elements match, invalid minContains",
"data": [
1
],
"valid": false
"valid": false,
"schema_id": "minContains_4_0"
},
{
"description": "all elements match, invalid maxContains",
@ -207,7 +224,8 @@
1,
1
],
"valid": false
"valid": false,
"schema_id": "minContains_4_0"
},
{
"description": "all elements match, valid maxContains and minContains",
@ -215,7 +233,8 @@
1,
1
],
"valid": true
"valid": true,
"schema_id": "minContains_4_0"
}
]
},
@ -224,13 +243,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"maxContains": 1,
"minContains": 3,
"extensible": true
"extensible": true,
"$id": "minContains_5_0"
}
]
},
@ -238,14 +257,16 @@
{
"description": "empty data",
"data": [],
"valid": false
"valid": false,
"schema_id": "minContains_5_0"
},
{
"description": "invalid minContains",
"data": [
1
],
"valid": false
"valid": false,
"schema_id": "minContains_5_0"
},
{
"description": "invalid maxContains",
@ -254,7 +275,8 @@
1,
1
],
"valid": false
"valid": false,
"schema_id": "minContains_5_0"
},
{
"description": "invalid maxContains and minContains",
@ -262,7 +284,8 @@
1,
1
],
"valid": false
"valid": false,
"schema_id": "minContains_5_0"
}
]
},
@ -271,12 +294,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"minContains": 0,
"extensible": true
"extensible": true,
"$id": "minContains_6_0"
}
]
},
@ -284,14 +307,16 @@
{
"description": "empty data",
"data": [],
"valid": true
"valid": true,
"schema_id": "minContains_6_0"
},
{
"description": "minContains = 0 makes contains always pass",
"data": [
2
],
"valid": true
"valid": true,
"schema_id": "minContains_6_0"
}
]
},
@ -300,13 +325,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"minContains": 0,
"maxContains": 1,
"extensible": true
"extensible": true,
"$id": "minContains_7_0"
}
]
},
@ -314,14 +339,16 @@
{
"description": "empty data",
"data": [],
"valid": true
"valid": true,
"schema_id": "minContains_7_0"
},
{
"description": "not more than maxContains",
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "minContains_7_0"
},
{
"description": "too many",
@ -329,7 +356,8 @@
1,
1
],
"valid": false
"valid": false,
"schema_id": "minContains_7_0"
}
]
},
@ -338,12 +366,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"const": 1
},
"minContains": 1,
"extensible": true
"extensible": true,
"$id": "minContains_8_0"
}
]
},
@ -354,7 +382,8 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "minContains_8_0"
}
]
}

View File

@ -4,9 +4,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minItems": 1,
"extensible": true
"extensible": true,
"$id": "minItems_0_0"
}
]
},
@ -17,24 +17,28 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "minItems_0_0"
},
{
"description": "exact length is valid",
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "minItems_0_0"
},
{
"description": "too short is invalid",
"data": [],
"valid": false
"valid": false,
"schema_id": "minItems_0_0"
},
{
"description": "ignores non-arrays",
"data": "",
"valid": true
"valid": true,
"schema_id": "minItems_0_0"
}
]
},
@ -43,9 +47,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minItems": 1.0,
"extensible": true
"minItems": 1,
"extensible": true,
"$id": "minItems_1_0"
}
]
},
@ -56,12 +60,14 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "minItems_1_0"
},
{
"description": "too short is invalid",
"data": [],
"valid": false
"valid": false,
"schema_id": "minItems_1_0"
}
]
},
@ -70,9 +76,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minItems": 1,
"extensible": true
"extensible": true,
"$id": "minItems_2_0"
}
]
},
@ -82,7 +88,8 @@
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "minItems_2_0"
}
]
}

View File

@ -4,8 +4,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minLength": 2
"minLength": 2,
"$id": "minLength_0_0"
}
]
},
@ -13,27 +13,32 @@
{
"description": "longer is valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "minLength_0_0"
},
{
"description": "exact length is valid",
"data": "fo",
"valid": true
"valid": true,
"schema_id": "minLength_0_0"
},
{
"description": "too short is invalid",
"data": "f",
"valid": false
"valid": false,
"schema_id": "minLength_0_0"
},
{
"description": "ignores non-strings",
"data": 1,
"valid": true
"valid": true,
"schema_id": "minLength_0_0"
},
{
"description": "one grapheme is not long enough",
"data": "\uD83D\uDCA9",
"valid": false
"data": "💩",
"valid": false,
"schema_id": "minLength_0_0"
}
]
},
@ -42,8 +47,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minLength": 2.0
"minLength": 2,
"$id": "minLength_1_0"
}
]
},
@ -51,12 +56,14 @@
{
"description": "longer is valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "minLength_1_0"
},
{
"description": "too short is invalid",
"data": "f",
"valid": false
"valid": false,
"schema_id": "minLength_1_0"
}
]
}

View File

@ -4,9 +4,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minProperties": 1,
"extensible": true
"extensible": true,
"$id": "minProperties_0_0"
}
]
},
@ -17,34 +17,40 @@
"foo": 1,
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "minProperties_0_0"
},
{
"description": "exact length is valid",
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "minProperties_0_0"
},
{
"description": "too short is invalid",
"data": {},
"valid": false
"valid": false,
"schema_id": "minProperties_0_0"
},
{
"description": "ignores arrays",
"data": [],
"valid": true
"valid": true,
"schema_id": "minProperties_0_0"
},
{
"description": "ignores strings",
"data": "",
"valid": true
"valid": true,
"schema_id": "minProperties_0_0"
},
{
"description": "ignores other non-objects",
"data": 12,
"valid": true
"valid": true,
"schema_id": "minProperties_0_0"
}
]
},
@ -53,9 +59,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minProperties": 1.0,
"extensible": true
"minProperties": 1,
"extensible": true,
"$id": "minProperties_1_0"
}
]
},
@ -66,12 +72,14 @@
"foo": 1,
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "minProperties_1_0"
},
{
"description": "too short is invalid",
"data": {},
"valid": false
"valid": false,
"schema_id": "minProperties_1_0"
}
]
},
@ -80,9 +88,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minProperties": 1,
"extensible": true
"extensible": true,
"$id": "minProperties_2_0"
}
]
},
@ -92,7 +100,8 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "minProperties_2_0"
}
]
}

View File

@ -4,8 +4,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minimum": 1.1
"minimum": 1.1,
"$id": "minimum_0_0"
}
]
},
@ -13,22 +13,26 @@
{
"description": "above the minimum is valid",
"data": 2.6,
"valid": true
"valid": true,
"schema_id": "minimum_0_0"
},
{
"description": "boundary point is valid",
"data": 1.1,
"valid": true
"valid": true,
"schema_id": "minimum_0_0"
},
{
"description": "below the minimum is invalid",
"data": 0.6,
"valid": false
"valid": false,
"schema_id": "minimum_0_0"
},
{
"description": "ignores non-numbers",
"data": "x",
"valid": true
"valid": true,
"schema_id": "minimum_0_0"
}
]
},
@ -37,8 +41,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minimum": -2
"minimum": -2,
"$id": "minimum_1_0"
}
]
},
@ -46,37 +50,44 @@
{
"description": "negative above the minimum is valid",
"data": -1,
"valid": true
"valid": true,
"schema_id": "minimum_1_0"
},
{
"description": "positive above the minimum is valid",
"data": 0,
"valid": true
"valid": true,
"schema_id": "minimum_1_0"
},
{
"description": "boundary point is valid",
"data": -2,
"valid": true
"valid": true,
"schema_id": "minimum_1_0"
},
{
"description": "boundary point with float is valid",
"data": -2.0,
"valid": true
"data": -2,
"valid": true,
"schema_id": "minimum_1_0"
},
{
"description": "float below the minimum is invalid",
"data": -2.0001,
"valid": false
"valid": false,
"schema_id": "minimum_1_0"
},
{
"description": "int below the minimum is invalid",
"data": -3,
"valid": false
"valid": false,
"schema_id": "minimum_1_0"
},
{
"description": "ignores non-numbers",
"data": "x",
"valid": true
"valid": true,
"schema_id": "minimum_1_0"
}
]
}

View File

@ -4,8 +4,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"multipleOf": 2
"multipleOf": 2,
"$id": "multipleOf_0_0"
}
]
},
@ -13,17 +13,20 @@
{
"description": "int by int",
"data": 10,
"valid": true
"valid": true,
"schema_id": "multipleOf_0_0"
},
{
"description": "int by int fail",
"data": 7,
"valid": false
"valid": false,
"schema_id": "multipleOf_0_0"
},
{
"description": "ignores non-numbers",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "multipleOf_0_0"
}
]
},
@ -32,8 +35,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"multipleOf": 1.5
"multipleOf": 1.5,
"$id": "multipleOf_1_0"
}
]
},
@ -41,17 +44,20 @@
{
"description": "zero is multiple of anything",
"data": 0,
"valid": true
"valid": true,
"schema_id": "multipleOf_1_0"
},
{
"description": "4.5 is multiple of 1.5",
"data": 4.5,
"valid": true
"valid": true,
"schema_id": "multipleOf_1_0"
},
{
"description": "35 is not multiple of 1.5",
"data": 35,
"valid": false
"valid": false,
"schema_id": "multipleOf_1_0"
}
]
},
@ -60,8 +66,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"multipleOf": 0.0001
"multipleOf": 0.0001,
"$id": "multipleOf_2_0"
}
]
},
@ -69,12 +75,14 @@
{
"description": "0.0075 is multiple of 0.0001",
"data": 0.0075,
"valid": true
"valid": true,
"schema_id": "multipleOf_2_0"
},
{
"description": "0.00751 is not multiple of 0.0001",
"data": 0.00751,
"valid": false
"valid": false,
"schema_id": "multipleOf_2_0"
}
]
},
@ -83,9 +91,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "integer",
"multipleOf": 1e-8
"multipleOf": 1e-8,
"$id": "multipleOf_3_0"
}
]
},
@ -93,7 +101,8 @@
{
"description": "any integer is a multiple of 1e-8",
"data": 12391239123,
"valid": true
"valid": true,
"schema_id": "multipleOf_3_0"
}
]
}

View File

@ -4,10 +4,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"not": {
"type": "integer"
}
},
"$id": "not_0_0"
}
]
},
@ -15,12 +15,14 @@
{
"description": "allowed",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "not_0_0"
},
{
"description": "disallowed",
"data": 1,
"valid": false
"valid": false,
"schema_id": "not_0_0"
}
]
},
@ -29,13 +31,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"not": {
"type": [
"integer",
"boolean"
]
}
},
"$id": "not_1_0"
}
]
},
@ -43,17 +45,20 @@
{
"description": "valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "not_1_0"
},
{
"description": "mismatch",
"data": 1,
"valid": false
"valid": false,
"schema_id": "not_1_0"
},
{
"description": "other mismatch",
"data": true,
"valid": false
"valid": false,
"schema_id": "not_1_0"
}
]
},
@ -62,7 +67,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"not": {
"type": "object",
"properties": {
@ -71,7 +75,8 @@
}
}
},
"extensible": true
"extensible": true,
"$id": "not_2_0"
}
]
},
@ -79,21 +84,24 @@
{
"description": "match",
"data": 1,
"valid": true
"valid": true,
"schema_id": "not_2_0"
},
{
"description": "other match",
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "not_2_0"
},
{
"description": "mismatch",
"data": {
"foo": "bar"
},
"valid": false
"valid": false,
"schema_id": "not_2_0"
}
]
},
@ -102,12 +110,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {
"not": {}
}
}
},
"$id": "not_3_0"
}
]
},
@ -118,12 +126,14 @@
"foo": 1,
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "not_3_0"
},
{
"description": "empty object is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "not_3_0"
}
]
},
@ -132,8 +142,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"not": {}
"not": {},
"$id": "not_4_0"
}
]
},
@ -141,51 +151,60 @@
{
"description": "number is invalid",
"data": 1,
"valid": false
"valid": false,
"schema_id": "not_4_0"
},
{
"description": "string is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "not_4_0"
},
{
"description": "boolean true is invalid",
"data": true,
"valid": false
"valid": false,
"schema_id": "not_4_0"
},
{
"description": "boolean false is invalid",
"data": false,
"valid": false
"valid": false,
"schema_id": "not_4_0"
},
{
"description": "null is invalid",
"data": null,
"valid": false
"valid": false,
"schema_id": "not_4_0"
},
{
"description": "object is invalid",
"data": {
"foo": "bar"
},
"valid": false
"valid": false,
"schema_id": "not_4_0"
},
{
"description": "empty object is invalid",
"data": {},
"valid": false
"valid": false,
"schema_id": "not_4_0"
},
{
"description": "array is invalid",
"data": [
"foo"
],
"valid": false
"valid": false,
"schema_id": "not_4_0"
},
{
"description": "empty array is invalid",
"data": [],
"valid": false
"valid": false,
"schema_id": "not_4_0"
}
]
},
@ -194,8 +213,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"not": true
"not": true,
"$id": "not_5_0"
}
]
},
@ -203,51 +222,60 @@
{
"description": "number is invalid",
"data": 1,
"valid": false
"valid": false,
"schema_id": "not_5_0"
},
{
"description": "string is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "not_5_0"
},
{
"description": "boolean true is invalid",
"data": true,
"valid": false
"valid": false,
"schema_id": "not_5_0"
},
{
"description": "boolean false is invalid",
"data": false,
"valid": false
"valid": false,
"schema_id": "not_5_0"
},
{
"description": "null is invalid",
"data": null,
"valid": false
"valid": false,
"schema_id": "not_5_0"
},
{
"description": "object is invalid",
"data": {
"foo": "bar"
},
"valid": false
"valid": false,
"schema_id": "not_5_0"
},
{
"description": "empty object is invalid",
"data": {},
"valid": false
"valid": false,
"schema_id": "not_5_0"
},
{
"description": "array is invalid",
"data": [
"foo"
],
"valid": false
"valid": false,
"schema_id": "not_5_0"
},
{
"description": "empty array is invalid",
"data": [],
"valid": false
"valid": false,
"schema_id": "not_5_0"
}
]
},
@ -256,9 +284,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"not": false,
"extensible": true
"extensible": true,
"$id": "not_6_0"
}
]
},
@ -266,51 +294,60 @@
{
"description": "number is valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "not_6_0"
},
{
"description": "string is valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "not_6_0"
},
{
"description": "boolean true is valid",
"data": true,
"valid": true
"valid": true,
"schema_id": "not_6_0"
},
{
"description": "boolean false is valid",
"data": false,
"valid": true
"valid": true,
"schema_id": "not_6_0"
},
{
"description": "null is valid",
"data": null,
"valid": true
"valid": true,
"schema_id": "not_6_0"
},
{
"description": "object is valid",
"data": {
"foo": "bar"
},
"valid": true
"valid": true,
"schema_id": "not_6_0"
},
{
"description": "empty object is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "not_6_0"
},
{
"description": "array is valid",
"data": [
"foo"
],
"valid": true
"valid": true,
"schema_id": "not_6_0"
},
{
"description": "empty array is valid",
"data": [],
"valid": true
"valid": true,
"schema_id": "not_6_0"
}
]
},
@ -319,10 +356,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"not": {
"not": {}
}
},
"$id": "not_7_0"
}
]
},
@ -330,7 +367,8 @@
{
"description": "any value is valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "not_7_0"
}
]
},
@ -339,11 +377,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"not": {
"type": "integer"
},
"extensible": true
"extensible": true,
"$id": "not_8_0"
}
]
},
@ -353,7 +391,8 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "not_8_0"
}
]
},
@ -362,10 +401,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"not": {
"type": "integer"
}
},
"$id": "not_9_0"
}
]
},
@ -375,7 +414,8 @@
"data": {
"foo": 1
},
"valid": false
"valid": false,
"schema_id": "not_9_0"
}
]
},
@ -384,7 +424,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"bar": {
"type": "string"
@ -393,7 +432,8 @@
"not": {
"type": "integer"
},
"extensible": true
"extensible": true,
"$id": "not_10_0"
}
]
},
@ -404,7 +444,8 @@
"bar": "baz",
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "not_10_0"
}
]
},
@ -413,7 +454,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"bar": {
"type": "string"
@ -421,7 +461,8 @@
},
"not": {
"type": "integer"
}
},
"$id": "not_11_0"
}
]
},
@ -432,14 +473,16 @@
"bar": "baz",
"foo": 1
},
"valid": false
"valid": false,
"schema_id": "not_11_0"
},
{
"description": "defined property allowed",
"data": {
"bar": "baz"
},
"valid": true
"valid": true,
"schema_id": "not_11_0"
}
]
}

View File

@ -4,7 +4,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "integer"
@ -12,7 +11,8 @@
{
"minimum": 2
}
]
],
"$id": "oneOf_0_0"
}
]
},
@ -20,22 +20,26 @@
{
"description": "first oneOf valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "oneOf_0_0"
},
{
"description": "second oneOf valid",
"data": 2.5,
"valid": true
"valid": true,
"schema_id": "oneOf_0_0"
},
{
"description": "both oneOf valid",
"data": 3,
"valid": false
"valid": false,
"schema_id": "oneOf_0_0"
},
{
"description": "neither oneOf valid",
"data": 1.5,
"valid": false
"valid": false,
"schema_id": "oneOf_0_0"
}
]
},
@ -44,7 +48,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"oneOf": [
{
@ -53,7 +56,8 @@
{
"maxLength": 4
}
]
],
"$id": "oneOf_1_0"
}
]
},
@ -61,17 +65,20 @@
{
"description": "mismatch base schema",
"data": 3,
"valid": false
"valid": false,
"schema_id": "oneOf_1_0"
},
{
"description": "one oneOf valid",
"data": "foobar",
"valid": true
"valid": true,
"schema_id": "oneOf_1_0"
},
{
"description": "both oneOf valid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "oneOf_1_0"
}
]
},
@ -80,12 +87,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
true,
true,
true
]
],
"$id": "oneOf_2_0"
}
]
},
@ -93,7 +100,8 @@
{
"description": "any value is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "oneOf_2_0"
}
]
},
@ -102,12 +110,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
true,
false,
false
]
],
"$id": "oneOf_3_0"
}
]
},
@ -115,7 +123,8 @@
{
"description": "any value is valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "oneOf_3_0"
}
]
},
@ -124,12 +133,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
true,
true,
false
]
],
"$id": "oneOf_4_0"
}
]
},
@ -137,7 +146,8 @@
{
"description": "any value is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "oneOf_4_0"
}
]
},
@ -146,12 +156,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
false,
false,
false
]
],
"$id": "oneOf_5_0"
}
]
},
@ -159,7 +169,8 @@
{
"description": "any value is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "oneOf_5_0"
}
]
},
@ -168,332 +179,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"properties": {
"bar": {
"type": "integer"
}
},
"required": [
"bar"
]
},
{
"properties": {
"foo": {
"type": "string"
}
},
"required": [
"foo"
]
}
]
}
]
},
"tests": [
{
"description": "first oneOf valid (complex)",
"data": {
"bar": 2
},
"valid": true
},
{
"description": "second oneOf valid (complex)",
"data": {
"foo": "baz"
},
"valid": true
},
{
"description": "both oneOf valid (complex)",
"data": {
"foo": "baz",
"bar": 2
},
"valid": false
},
{
"description": "neither oneOf valid (complex)",
"data": {
"foo": 2,
"bar": "quux"
},
"valid": false
}
]
},
{
"description": "oneOf with empty schema",
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "number"
},
{}
]
}
]
},
"tests": [
{
"description": "one valid - valid",
"data": "foo",
"valid": true
},
{
"description": "both valid - invalid",
"data": 123,
"valid": false
}
]
},
{
"description": "oneOf with required",
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": true,
"bar": true,
"baz": true
},
"oneOf": [
{
"required": [
"foo",
"bar"
]
},
{
"required": [
"foo",
"baz"
]
}
]
}
]
},
"tests": [
{
"description": "both invalid - invalid",
"data": {
"bar": 2
},
"valid": false
},
{
"description": "first valid - valid",
"data": {
"foo": 1,
"bar": 2
},
"valid": true
},
{
"description": "second valid - valid",
"data": {
"foo": 1,
"baz": 3
},
"valid": true
},
{
"description": "both valid - invalid",
"data": {
"foo": 1,
"bar": 2,
"baz": 3
},
"valid": false
},
{
"description": "extra property invalid (strict)",
"data": {
"foo": 1,
"bar": 2,
"extra": 3
},
"valid": false
}
]
},
{
"description": "oneOf with required (extensible)",
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"extensible": true,
"oneOf": [
{
"required": [
"foo",
"bar"
]
},
{
"required": [
"foo",
"baz"
]
}
]
}
]
},
"tests": [
{
"description": "both invalid - invalid",
"data": {
"bar": 2
},
"valid": false
},
{
"description": "first valid - valid",
"data": {
"foo": 1,
"bar": 2
},
"valid": true
},
{
"description": "second valid - valid",
"data": {
"foo": 1,
"baz": 3
},
"valid": true
},
{
"description": "both valid - invalid",
"data": {
"foo": 1,
"bar": 2,
"baz": 3
},
"valid": false
},
{
"description": "extra properties are valid (extensible)",
"data": {
"foo": 1,
"bar": 2,
"extra": "value"
},
"valid": true
}
]
},
{
"description": "oneOf with missing optional property",
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"properties": {
"bar": true,
"baz": true
},
"required": [
"bar"
]
},
{
"properties": {
"foo": true
},
"required": [
"foo"
]
}
]
}
]
},
"tests": [
{
"description": "first oneOf valid",
"data": {
"bar": 8
},
"valid": true
},
{
"description": "second oneOf valid",
"data": {
"foo": "foo"
},
"valid": true
},
{
"description": "both oneOf valid",
"data": {
"foo": "foo",
"bar": 8
},
"valid": false
},
{
"description": "neither oneOf valid",
"data": {
"baz": "quux"
},
"valid": false
}
]
},
{
"description": "nested oneOf, to check validation semantics",
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"oneOf": [
{
"type": "null"
}
]
}
]
}
]
},
"tests": [
{
"description": "null is valid",
"data": null,
"valid": true
},
{
"description": "anything non-null is invalid",
"data": 123,
"valid": false
}
]
},
{
"description": "extensible: true allows extra properties in oneOf",
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"properties": {
@ -516,7 +201,355 @@
]
}
],
"extensible": true
"$id": "oneOf_6_0"
}
]
},
"tests": [
{
"description": "first oneOf valid (complex)",
"data": {
"bar": 2
},
"valid": true,
"schema_id": "oneOf_6_0"
},
{
"description": "second oneOf valid (complex)",
"data": {
"foo": "baz"
},
"valid": true,
"schema_id": "oneOf_6_0"
},
{
"description": "both oneOf valid (complex)",
"data": {
"foo": "baz",
"bar": 2
},
"valid": false,
"schema_id": "oneOf_6_0"
},
{
"description": "neither oneOf valid (complex)",
"data": {
"foo": 2,
"bar": "quux"
},
"valid": false,
"schema_id": "oneOf_6_0"
}
]
},
{
"description": "oneOf with empty schema",
"database": {
"schemas": [
{
"oneOf": [
{
"type": "number"
},
{}
],
"$id": "oneOf_7_0"
}
]
},
"tests": [
{
"description": "one valid - valid",
"data": "foo",
"valid": true,
"schema_id": "oneOf_7_0"
},
{
"description": "both valid - invalid",
"data": 123,
"valid": false,
"schema_id": "oneOf_7_0"
}
]
},
{
"description": "oneOf with required",
"database": {
"schemas": [
{
"type": "object",
"properties": {
"foo": true,
"bar": true,
"baz": true
},
"oneOf": [
{
"required": [
"foo",
"bar"
]
},
{
"required": [
"foo",
"baz"
]
}
],
"$id": "oneOf_8_0"
}
]
},
"tests": [
{
"description": "both invalid - invalid",
"data": {
"bar": 2
},
"valid": false,
"schema_id": "oneOf_8_0"
},
{
"description": "first valid - valid",
"data": {
"foo": 1,
"bar": 2
},
"valid": true,
"schema_id": "oneOf_8_0"
},
{
"description": "second valid - valid",
"data": {
"foo": 1,
"baz": 3
},
"valid": true,
"schema_id": "oneOf_8_0"
},
{
"description": "both valid - invalid",
"data": {
"foo": 1,
"bar": 2,
"baz": 3
},
"valid": false,
"schema_id": "oneOf_8_0"
},
{
"description": "extra property invalid (strict)",
"data": {
"foo": 1,
"bar": 2,
"extra": 3
},
"valid": false,
"schema_id": "oneOf_8_0"
}
]
},
{
"description": "oneOf with required (extensible)",
"database": {
"schemas": [
{
"type": "object",
"extensible": true,
"oneOf": [
{
"required": [
"foo",
"bar"
]
},
{
"required": [
"foo",
"baz"
]
}
],
"$id": "oneOf_9_0"
}
]
},
"tests": [
{
"description": "both invalid - invalid",
"data": {
"bar": 2
},
"valid": false,
"schema_id": "oneOf_9_0"
},
{
"description": "first valid - valid",
"data": {
"foo": 1,
"bar": 2
},
"valid": true,
"schema_id": "oneOf_9_0"
},
{
"description": "second valid - valid",
"data": {
"foo": 1,
"baz": 3
},
"valid": true,
"schema_id": "oneOf_9_0"
},
{
"description": "both valid - invalid",
"data": {
"foo": 1,
"bar": 2,
"baz": 3
},
"valid": false,
"schema_id": "oneOf_9_0"
},
{
"description": "extra properties are valid (extensible)",
"data": {
"foo": 1,
"bar": 2,
"extra": "value"
},
"valid": true,
"schema_id": "oneOf_9_0"
}
]
},
{
"description": "oneOf with missing optional property",
"database": {
"schemas": [
{
"oneOf": [
{
"properties": {
"bar": true,
"baz": true
},
"required": [
"bar"
]
},
{
"properties": {
"foo": true
},
"required": [
"foo"
]
}
],
"$id": "oneOf_10_0"
}
]
},
"tests": [
{
"description": "first oneOf valid",
"data": {
"bar": 8
},
"valid": true,
"schema_id": "oneOf_10_0"
},
{
"description": "second oneOf valid",
"data": {
"foo": "foo"
},
"valid": true,
"schema_id": "oneOf_10_0"
},
{
"description": "both oneOf valid",
"data": {
"foo": "foo",
"bar": 8
},
"valid": false,
"schema_id": "oneOf_10_0"
},
{
"description": "neither oneOf valid",
"data": {
"baz": "quux"
},
"valid": false,
"schema_id": "oneOf_10_0"
}
]
},
{
"description": "nested oneOf, to check validation semantics",
"database": {
"schemas": [
{
"oneOf": [
{
"oneOf": [
{
"type": "null"
}
]
}
],
"$id": "oneOf_11_0"
}
]
},
"tests": [
{
"description": "null is valid",
"data": null,
"valid": true,
"schema_id": "oneOf_11_0"
},
{
"description": "anything non-null is invalid",
"data": 123,
"valid": false,
"schema_id": "oneOf_11_0"
}
]
},
{
"description": "extensible: true allows extra properties in oneOf",
"database": {
"schemas": [
{
"oneOf": [
{
"properties": {
"bar": {
"type": "integer"
}
},
"required": [
"bar"
]
},
{
"properties": {
"foo": {
"type": "string"
}
},
"required": [
"foo"
]
}
],
"extensible": true,
"$id": "oneOf_12_0"
}
]
},
@ -527,7 +560,8 @@
"bar": 2,
"extra": "prop"
},
"valid": true
"valid": true,
"schema_id": "oneOf_12_0"
}
]
}

View File

@ -4,8 +4,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"pattern": "^a*$"
"pattern": "^a*$",
"$id": "pattern_0_0"
}
]
},
@ -13,42 +13,50 @@
{
"description": "a matching pattern is valid",
"data": "aaa",
"valid": true
"valid": true,
"schema_id": "pattern_0_0"
},
{
"description": "a non-matching pattern is invalid",
"data": "abc",
"valid": false
"valid": false,
"schema_id": "pattern_0_0"
},
{
"description": "ignores booleans",
"data": true,
"valid": true
"valid": true,
"schema_id": "pattern_0_0"
},
{
"description": "ignores integers",
"data": 123,
"valid": true
"valid": true,
"schema_id": "pattern_0_0"
},
{
"description": "ignores floats",
"data": 1.0,
"valid": true
"data": 1,
"valid": true,
"schema_id": "pattern_0_0"
},
{
"description": "ignores objects",
"data": {},
"valid": true
"valid": true,
"schema_id": "pattern_0_0"
},
{
"description": "ignores arrays",
"data": [],
"valid": true
"valid": true,
"schema_id": "pattern_0_0"
},
{
"description": "ignores null",
"data": null,
"valid": true
"valid": true,
"schema_id": "pattern_0_0"
}
]
},
@ -57,8 +65,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"pattern": "a+"
"pattern": "a+",
"$id": "pattern_1_0"
}
]
},
@ -66,7 +74,8 @@
{
"description": "matches a substring",
"data": "xxaayy",
"valid": true
"valid": true,
"schema_id": "pattern_1_0"
}
]
}

View File

@ -4,13 +4,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {
"f.*o": {
"type": "integer"
}
},
"items": {}
"items": {},
"$id": "patternProperties_0_0"
}
]
},
@ -20,7 +20,8 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "patternProperties_0_0"
},
{
"description": "multiple valid matches is valid",
@ -28,7 +29,8 @@
"foo": 1,
"foooooo": 2
},
"valid": true
"valid": true,
"schema_id": "patternProperties_0_0"
},
{
"description": "a single invalid match is invalid",
@ -36,7 +38,8 @@
"foo": "bar",
"fooooo": 2
},
"valid": false
"valid": false,
"schema_id": "patternProperties_0_0"
},
{
"description": "multiple invalid matches is invalid",
@ -44,24 +47,28 @@
"foo": "bar",
"foooooo": "baz"
},
"valid": false
"valid": false,
"schema_id": "patternProperties_0_0"
},
{
"description": "ignores arrays",
"data": [
"foo"
],
"valid": true
"valid": true,
"schema_id": "patternProperties_0_0"
},
{
"description": "ignores strings",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "patternProperties_0_0"
},
{
"description": "ignores other non-objects",
"data": 12,
"valid": true
"valid": true,
"schema_id": "patternProperties_0_0"
},
{
"description": "extra property not matching pattern is INVALID (strict by default)",
@ -69,7 +76,8 @@
"foo": 1,
"extra": 2
},
"valid": false
"valid": false,
"schema_id": "patternProperties_0_0"
}
]
},
@ -78,7 +86,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {
"a*": {
"type": "integer"
@ -86,7 +93,8 @@
"aaa*": {
"maximum": 20
}
}
},
"$id": "patternProperties_1_0"
}
]
},
@ -96,14 +104,16 @@
"data": {
"a": 21
},
"valid": true
"valid": true,
"schema_id": "patternProperties_1_0"
},
{
"description": "a simultaneous match is valid",
"data": {
"aaaa": 18
},
"valid": true
"valid": true,
"schema_id": "patternProperties_1_0"
},
{
"description": "multiple matches is valid",
@ -111,21 +121,24 @@
"a": 21,
"aaaa": 18
},
"valid": true
"valid": true,
"schema_id": "patternProperties_1_0"
},
{
"description": "an invalid due to one is invalid",
"data": {
"a": "bar"
},
"valid": false
"valid": false,
"schema_id": "patternProperties_1_0"
},
{
"description": "an invalid due to the other is invalid",
"data": {
"aaaa": 31
},
"valid": false
"valid": false,
"schema_id": "patternProperties_1_0"
},
{
"description": "an invalid due to both is invalid",
@ -133,7 +146,8 @@
"aaa": "foo",
"aaaa": 31
},
"valid": false
"valid": false,
"schema_id": "patternProperties_1_0"
}
]
},
@ -142,7 +156,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {
"[0-9]{2,}": {
"type": "boolean"
@ -151,7 +164,8 @@
"type": "string"
}
},
"extensible": true
"extensible": true,
"$id": "patternProperties_2_0"
}
]
},
@ -161,28 +175,32 @@
"data": {
"answer 1": "42"
},
"valid": true
"valid": true,
"schema_id": "patternProperties_2_0"
},
{
"description": "recognized members are accounted for",
"data": {
"a31b": null
},
"valid": false
"valid": false,
"schema_id": "patternProperties_2_0"
},
{
"description": "regexes are case sensitive",
"data": {
"a_x_3": 3
},
"valid": true
"valid": true,
"schema_id": "patternProperties_2_0"
},
{
"description": "regexes are case sensitive, 2",
"data": {
"a_X_3": 3
},
"valid": false
"valid": false,
"schema_id": "patternProperties_2_0"
}
]
},
@ -191,11 +209,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {
"f.*": true,
"b.*": false
}
},
"$id": "patternProperties_3_0"
}
]
},
@ -205,14 +223,16 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "patternProperties_3_0"
},
{
"description": "object with property matching schema false is invalid",
"data": {
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "patternProperties_3_0"
},
{
"description": "object with both properties is invalid",
@ -220,19 +240,22 @@
"foo": 1,
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "patternProperties_3_0"
},
{
"description": "object with a property matching both true and false is invalid",
"data": {
"foobar": 1
},
"valid": false
"valid": false,
"schema_id": "patternProperties_3_0"
},
{
"description": "empty object is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "patternProperties_3_0"
}
]
},
@ -241,12 +264,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {
"^.*bar$": {
"type": "null"
}
}
},
"$id": "patternProperties_4_0"
}
]
},
@ -256,7 +279,8 @@
"data": {
"foobar": null
},
"valid": true
"valid": true,
"schema_id": "patternProperties_4_0"
}
]
},
@ -265,13 +289,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {
"f.*o": {
"type": "integer"
}
},
"extensible": true
"extensible": true,
"$id": "patternProperties_5_0"
}
]
},
@ -281,14 +305,16 @@
"data": {
"bar": 1
},
"valid": true
"valid": true,
"schema_id": "patternProperties_5_0"
},
{
"description": "property matching pattern MUST still be valid",
"data": {
"foo": "invalid string"
},
"valid": false
"valid": false,
"schema_id": "patternProperties_5_0"
}
]
}

View File

@ -4,7 +4,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{
"type": "integer"
@ -12,7 +11,8 @@
{
"type": "string"
}
]
],
"$id": "prefixItems_0_0"
}
]
},
@ -23,7 +23,8 @@
1,
"foo"
],
"valid": true
"valid": true,
"schema_id": "prefixItems_0_0"
},
{
"description": "wrong types",
@ -31,14 +32,16 @@
"foo",
1
],
"valid": false
"valid": false,
"schema_id": "prefixItems_0_0"
},
{
"description": "incomplete array of items",
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "prefixItems_0_0"
},
{
"description": "array with additional items (invalid due to strictness)",
@ -47,12 +50,14 @@
"foo",
true
],
"valid": false
"valid": false,
"schema_id": "prefixItems_0_0"
},
{
"description": "empty array",
"data": [],
"valid": true
"valid": true,
"schema_id": "prefixItems_0_0"
},
{
"description": "JavaScript pseudo-array is valid (invalid due to strict object validation)",
@ -61,7 +66,8 @@
"1": "valid",
"length": 2
},
"valid": false
"valid": false,
"schema_id": "prefixItems_0_0"
}
]
},
@ -70,11 +76,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
true,
false
]
],
"$id": "prefixItems_1_0"
}
]
},
@ -84,7 +90,8 @@
"data": [
1
],
"valid": true
"valid": true,
"schema_id": "prefixItems_1_0"
},
{
"description": "array with two items is invalid",
@ -92,12 +99,14 @@
1,
"foo"
],
"valid": false
"valid": false,
"schema_id": "prefixItems_1_0"
},
{
"description": "empty array is valid",
"data": [],
"valid": true
"valid": true,
"schema_id": "prefixItems_1_0"
}
]
},
@ -106,13 +115,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{
"type": "integer"
}
],
"extensible": true
"extensible": true,
"$id": "prefixItems_2_0"
}
]
},
@ -124,7 +133,8 @@
"foo",
false
],
"valid": true
"valid": true,
"schema_id": "prefixItems_2_0"
}
]
},
@ -133,12 +143,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{
"type": "null"
}
]
],
"$id": "prefixItems_3_0"
}
]
},
@ -148,7 +158,8 @@
"data": [
null
],
"valid": true
"valid": true,
"schema_id": "prefixItems_3_0"
}
]
},
@ -157,13 +168,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{
"type": "integer"
}
],
"extensible": true
"extensible": true,
"$id": "prefixItems_4_0"
}
]
},
@ -174,7 +185,8 @@
1,
"foo"
],
"valid": true
"valid": true,
"schema_id": "prefixItems_4_0"
}
]
}

View File

@ -4,7 +4,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {
"type": "integer"
@ -12,7 +11,8 @@
"bar": {
"type": "string"
}
}
},
"$id": "properties_0_0"
}
]
},
@ -23,7 +23,8 @@
"foo": 1,
"bar": "baz"
},
"valid": true
"valid": true,
"schema_id": "properties_0_0"
},
{
"description": "one property invalid is invalid",
@ -31,7 +32,8 @@
"foo": 1,
"bar": {}
},
"valid": false
"valid": false,
"schema_id": "properties_0_0"
},
{
"description": "both properties invalid is invalid",
@ -39,22 +41,26 @@
"foo": [],
"bar": {}
},
"valid": false
"valid": false,
"schema_id": "properties_0_0"
},
{
"description": "doesn't invalidate other properties",
"data": {},
"valid": true
"valid": true,
"schema_id": "properties_0_0"
},
{
"description": "ignores arrays",
"data": [],
"valid": true
"valid": true,
"schema_id": "properties_0_0"
},
{
"description": "ignores other non-objects",
"data": 12,
"valid": true
"valid": true,
"schema_id": "properties_0_0"
}
]
},
@ -63,11 +69,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": true,
"bar": false
}
},
"$id": "properties_1_0"
}
]
},
@ -75,21 +81,24 @@
{
"description": "no property present is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "properties_1_0"
},
{
"description": "only 'true' property present is valid",
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "properties_1_0"
},
{
"description": "only 'false' property present is invalid",
"data": {
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "properties_1_0"
},
{
"description": "both properties present is invalid",
@ -97,7 +106,8 @@
"foo": 1,
"bar": 2
},
"valid": false
"valid": false,
"schema_id": "properties_1_0"
}
]
},
@ -106,7 +116,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo\nbar": {
"type": "number"
@ -126,7 +135,8 @@
"foo\fbar": {
"type": "number"
}
}
},
"$id": "properties_2_0"
}
]
},
@ -141,7 +151,8 @@
"foo\tbar": 1,
"foo\fbar": 1
},
"valid": true
"valid": true,
"schema_id": "properties_2_0"
},
{
"description": "object with strings is invalid",
@ -153,7 +164,8 @@
"foo\tbar": "1",
"foo\fbar": "1"
},
"valid": false
"valid": false,
"schema_id": "properties_2_0"
}
]
},
@ -162,12 +174,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {
"type": "null"
}
}
},
"$id": "properties_3_0"
}
]
},
@ -177,7 +189,8 @@
"data": {
"foo": null
},
"valid": true
"valid": true,
"schema_id": "properties_3_0"
}
]
},
@ -187,7 +200,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"__proto__": {
"type": "number"
@ -202,7 +214,8 @@
"constructor": {
"type": "number"
}
}
},
"$id": "properties_4_0"
}
]
},
@ -210,24 +223,28 @@
{
"description": "ignores arrays",
"data": [],
"valid": true
"valid": true,
"schema_id": "properties_4_0"
},
{
"description": "ignores other non-objects",
"data": 12,
"valid": true
"valid": true,
"schema_id": "properties_4_0"
},
{
"description": "none of the properties mentioned",
"data": {},
"valid": true
"valid": true,
"schema_id": "properties_4_0"
},
{
"description": "__proto__ not valid",
"data": {
"__proto__": "foo"
},
"valid": false
"valid": false,
"schema_id": "properties_4_0"
},
{
"description": "toString not valid",
@ -236,7 +253,8 @@
"length": 37
}
},
"valid": false
"valid": false,
"schema_id": "properties_4_0"
},
{
"description": "constructor not valid",
@ -245,7 +263,8 @@
"length": 37
}
},
"valid": false
"valid": false,
"schema_id": "properties_4_0"
},
{
"description": "all present and valid",
@ -256,7 +275,8 @@
},
"constructor": 37
},
"valid": true
"valid": true,
"schema_id": "properties_4_0"
}
]
},
@ -265,13 +285,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {
"type": "integer"
}
},
"extensible": true
"extensible": true,
"$id": "properties_5_0"
}
]
},
@ -282,7 +302,8 @@
"foo": 1,
"bar": "baz"
},
"valid": true
"valid": true,
"schema_id": "properties_5_0"
}
]
},
@ -291,12 +312,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {
"type": "string"
}
}
},
"$id": "properties_6_0"
}
]
},
@ -307,7 +328,8 @@
"foo": "bar",
"extra": 1
},
"valid": false
"valid": false,
"schema_id": "properties_6_0"
}
]
},
@ -316,7 +338,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"nested": {
"properties": {
@ -325,7 +346,8 @@
}
}
}
}
},
"$id": "properties_7_0"
}
]
},
@ -338,7 +360,8 @@
"extra": 1
}
},
"valid": false
"valid": false,
"schema_id": "properties_7_0"
}
]
},
@ -347,7 +370,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"nested": {
"extensible": true,
@ -357,7 +379,8 @@
}
}
}
}
},
"$id": "properties_8_0"
}
]
},
@ -370,7 +393,8 @@
"extra": 1
}
},
"valid": true
"valid": true,
"schema_id": "properties_8_0"
}
]
},
@ -379,7 +403,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"extensible": true,
"properties": {
"nested": {
@ -389,7 +412,8 @@
}
}
}
}
},
"$id": "properties_9_0"
}
]
},
@ -402,7 +426,8 @@
"extra": 1
}
},
"valid": true
"valid": true,
"schema_id": "properties_9_0"
}
]
},
@ -411,7 +436,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"extensible": true,
"properties": {
"nested": {
@ -422,7 +446,8 @@
}
}
}
}
},
"$id": "properties_10_0"
}
]
},
@ -435,7 +460,8 @@
"extra": 1
}
},
"valid": false
"valid": false,
"schema_id": "properties_10_0"
}
]
},
@ -444,7 +470,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"list": {
"type": "array",
@ -456,7 +481,8 @@
}
}
}
}
},
"$id": "properties_11_0"
}
]
},
@ -471,7 +497,8 @@
}
]
},
"valid": false
"valid": false,
"schema_id": "properties_11_0"
}
]
},
@ -480,7 +507,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"extensible": true,
"properties": {
"list": {
@ -493,7 +519,8 @@
}
}
}
}
},
"$id": "properties_12_0"
}
]
},
@ -508,7 +535,8 @@
}
]
},
"valid": true
"valid": true,
"schema_id": "properties_12_0"
}
]
}

View File

@ -4,11 +4,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"propertyNames": {
"maxLength": 3
},
"extensible": true
"extensible": true,
"$id": "propertyNames_0_0"
}
]
},
@ -19,7 +19,8 @@
"f": {},
"foo": {}
},
"valid": true
"valid": true,
"schema_id": "propertyNames_0_0"
},
{
"description": "some property names invalid",
@ -27,12 +28,14 @@
"foo": {},
"foobar": {}
},
"valid": false
"valid": false,
"schema_id": "propertyNames_0_0"
},
{
"description": "object without properties is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "propertyNames_0_0"
},
{
"description": "ignores arrays",
@ -42,17 +45,20 @@
3,
4
],
"valid": true
"valid": true,
"schema_id": "propertyNames_0_0"
},
{
"description": "ignores strings",
"data": "foobar",
"valid": true
"valid": true,
"schema_id": "propertyNames_0_0"
},
{
"description": "ignores other non-objects",
"data": 12,
"valid": true
"valid": true,
"schema_id": "propertyNames_0_0"
}
]
},
@ -61,11 +67,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"propertyNames": {
"pattern": "^a+$"
},
"extensible": true
"extensible": true,
"$id": "propertyNames_1_0"
}
]
},
@ -77,19 +83,22 @@
"aa": {},
"aaa": {}
},
"valid": true
"valid": true,
"schema_id": "propertyNames_1_0"
},
{
"description": "non-matching property name is invalid",
"data": {
"aaA": {}
},
"valid": false
"valid": false,
"schema_id": "propertyNames_1_0"
},
{
"description": "object without properties is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "propertyNames_1_0"
}
]
},
@ -98,9 +107,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"propertyNames": true,
"extensible": true
"extensible": true,
"$id": "propertyNames_2_0"
}
]
},
@ -110,12 +119,14 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "propertyNames_2_0"
},
{
"description": "empty object is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "propertyNames_2_0"
}
]
},
@ -124,9 +135,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"propertyNames": false,
"extensible": true
"extensible": true,
"$id": "propertyNames_3_0"
}
]
},
@ -136,12 +147,14 @@
"data": {
"foo": 1
},
"valid": false
"valid": false,
"schema_id": "propertyNames_3_0"
},
{
"description": "empty object is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "propertyNames_3_0"
}
]
},
@ -150,11 +163,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"propertyNames": {
"const": "foo"
},
"extensible": true
"extensible": true,
"$id": "propertyNames_4_0"
}
]
},
@ -164,19 +177,22 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "propertyNames_4_0"
},
{
"description": "object with any other property is invalid",
"data": {
"bar": 1
},
"valid": false
"valid": false,
"schema_id": "propertyNames_4_0"
},
{
"description": "empty object is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "propertyNames_4_0"
}
]
},
@ -185,14 +201,14 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"propertyNames": {
"enum": [
"foo",
"bar"
]
},
"extensible": true
"extensible": true,
"$id": "propertyNames_5_0"
}
]
},
@ -202,7 +218,8 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "propertyNames_5_0"
},
{
"description": "object with property foo and bar is valid",
@ -210,19 +227,22 @@
"foo": 1,
"bar": 1
},
"valid": true
"valid": true,
"schema_id": "propertyNames_5_0"
},
{
"description": "object with any other property is invalid",
"data": {
"baz": 1
},
"valid": false
"valid": false,
"schema_id": "propertyNames_5_0"
},
{
"description": "empty object is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "propertyNames_5_0"
}
]
},
@ -231,11 +251,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"propertyNames": {
"maxLength": 3
},
"extensible": true
"extensible": true,
"$id": "propertyNames_6_0"
}
]
},
@ -245,14 +265,16 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "propertyNames_6_0"
},
{
"description": "extra property with invalid name is invalid",
"data": {
"foobar": 1
},
"valid": false
"valid": false,
"schema_id": "propertyNames_6_0"
}
]
}

1807
tests/fixtures/ref.json vendored

File diff suppressed because it is too large Load Diff

View File

@ -4,14 +4,14 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {},
"bar": {}
},
"required": [
"foo"
]
],
"$id": "required_0_0"
}
]
},
@ -21,39 +21,46 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "required_0_0"
},
{
"description": "non-present required property is invalid",
"data": {
"bar": 1
},
"valid": false
"valid": false,
"schema_id": "required_0_0"
},
{
"description": "ignores arrays",
"data": [],
"valid": true
"valid": true,
"schema_id": "required_0_0"
},
{
"description": "ignores strings",
"data": "",
"valid": true
"valid": true,
"schema_id": "required_0_0"
},
{
"description": "ignores other non-objects",
"data": 12,
"valid": true
"valid": true,
"schema_id": "required_0_0"
},
{
"description": "ignores null",
"data": null,
"valid": true
"valid": true,
"schema_id": "required_0_0"
},
{
"description": "ignores boolean",
"data": true,
"valid": true
"valid": true,
"schema_id": "required_0_0"
}
]
},
@ -62,10 +69,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {}
}
},
"$id": "required_1_0"
}
]
},
@ -73,7 +80,8 @@
{
"description": "not required by default",
"data": {},
"valid": true
"valid": true,
"schema_id": "required_1_0"
}
]
},
@ -82,11 +90,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {}
},
"required": []
"required": [],
"$id": "required_2_0"
}
]
},
@ -94,7 +102,8 @@
{
"description": "property not required",
"data": {},
"valid": true
"valid": true,
"schema_id": "required_2_0"
}
]
},
@ -103,7 +112,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"foo\nbar",
"foo\"bar",
@ -112,7 +120,8 @@
"foo\tbar",
"foo\fbar"
],
"extensible": true
"extensible": true,
"$id": "required_3_0"
}
]
},
@ -127,7 +136,8 @@
"foo\tbar": 1,
"foo\fbar": 1
},
"valid": true
"valid": true,
"schema_id": "required_3_0"
},
{
"description": "object with some properties missing is invalid",
@ -135,7 +145,8 @@
"foo\nbar": "1",
"foo\"bar": "1"
},
"valid": false
"valid": false,
"schema_id": "required_3_0"
}
]
},
@ -145,13 +156,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"__proto__",
"toString",
"constructor"
],
"extensible": true
"extensible": true,
"$id": "required_4_0"
}
]
},
@ -159,24 +170,28 @@
{
"description": "ignores arrays",
"data": [],
"valid": true
"valid": true,
"schema_id": "required_4_0"
},
{
"description": "ignores other non-objects",
"data": 12,
"valid": true
"valid": true,
"schema_id": "required_4_0"
},
{
"description": "none of the properties mentioned",
"data": {},
"valid": false
"valid": false,
"schema_id": "required_4_0"
},
{
"description": "__proto__ present",
"data": {
"__proto__": "foo"
},
"valid": false
"valid": false,
"schema_id": "required_4_0"
},
{
"description": "toString present",
@ -185,7 +200,8 @@
"length": 37
}
},
"valid": false
"valid": false,
"schema_id": "required_4_0"
},
{
"description": "constructor present",
@ -194,7 +210,8 @@
"length": 37
}
},
"valid": false
"valid": false,
"schema_id": "required_4_0"
},
{
"description": "all present",
@ -205,7 +222,8 @@
},
"constructor": 37
},
"valid": true
"valid": true,
"schema_id": "required_4_0"
}
]
},
@ -214,11 +232,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"foo"
],
"extensible": true
"extensible": true,
"$id": "required_5_0"
}
]
},
@ -229,7 +247,8 @@
"foo": 1,
"bar": 2
},
"valid": true
"valid": true,
"schema_id": "required_5_0"
}
]
}

View File

@ -4,8 +4,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "integer"
"type": "integer",
"$id": "type_0_0"
}
]
},
@ -13,47 +13,56 @@
{
"description": "an integer is an integer",
"data": 1,
"valid": true
"valid": true,
"schema_id": "type_0_0"
},
{
"description": "a float with zero fractional part is an integer",
"data": 1.0,
"valid": true
"data": 1,
"valid": true,
"schema_id": "type_0_0"
},
{
"description": "a float is not an integer",
"data": 1.1,
"valid": false
"valid": false,
"schema_id": "type_0_0"
},
{
"description": "a string is not an integer",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "type_0_0"
},
{
"description": "a string is still not an integer, even if it looks like one",
"data": "1",
"valid": false
"valid": false,
"schema_id": "type_0_0"
},
{
"description": "an object is not an integer",
"data": {},
"valid": false
"valid": false,
"schema_id": "type_0_0"
},
{
"description": "an array is not an integer",
"data": [],
"valid": false
"valid": false,
"schema_id": "type_0_0"
},
{
"description": "a boolean is not an integer",
"data": true,
"valid": false
"valid": false,
"schema_id": "type_0_0"
},
{
"description": "null is not an integer",
"data": null,
"valid": false
"valid": false,
"schema_id": "type_0_0"
}
]
},
@ -62,8 +71,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "number"
"type": "number",
"$id": "type_1_0"
}
]
},
@ -71,47 +80,56 @@
{
"description": "an integer is a number",
"data": 1,
"valid": true
"valid": true,
"schema_id": "type_1_0"
},
{
"description": "a float with zero fractional part is a number (and an integer)",
"data": 1.0,
"valid": true
"data": 1,
"valid": true,
"schema_id": "type_1_0"
},
{
"description": "a float is a number",
"data": 1.1,
"valid": true
"valid": true,
"schema_id": "type_1_0"
},
{
"description": "a string is not a number",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "type_1_0"
},
{
"description": "a string is still not a number, even if it looks like one",
"data": "1",
"valid": false
"valid": false,
"schema_id": "type_1_0"
},
{
"description": "an object is not a number",
"data": {},
"valid": false
"valid": false,
"schema_id": "type_1_0"
},
{
"description": "an array is not a number",
"data": [],
"valid": false
"valid": false,
"schema_id": "type_1_0"
},
{
"description": "a boolean is not a number",
"data": true,
"valid": false
"valid": false,
"schema_id": "type_1_0"
},
{
"description": "null is not a number",
"data": null,
"valid": false
"valid": false,
"schema_id": "type_1_0"
}
]
},
@ -120,8 +138,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string"
"type": "string",
"$id": "type_2_0"
}
]
},
@ -129,47 +147,56 @@
{
"description": "1 is not a string",
"data": 1,
"valid": false
"valid": false,
"schema_id": "type_2_0"
},
{
"description": "a float is not a string",
"data": 1.1,
"valid": false
"valid": false,
"schema_id": "type_2_0"
},
{
"description": "a string is a string",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "type_2_0"
},
{
"description": "a string is still a string, even if it looks like a number",
"data": "1",
"valid": true
"valid": true,
"schema_id": "type_2_0"
},
{
"description": "an empty string is still a string",
"data": "",
"valid": true
"valid": true,
"schema_id": "type_2_0"
},
{
"description": "an object is not a string",
"data": {},
"valid": false
"valid": false,
"schema_id": "type_2_0"
},
{
"description": "an array is not a string",
"data": [],
"valid": false
"valid": false,
"schema_id": "type_2_0"
},
{
"description": "a boolean is not a string",
"data": true,
"valid": false
"valid": false,
"schema_id": "type_2_0"
},
{
"description": "null is not a string",
"data": null,
"valid": false
"valid": false,
"schema_id": "type_2_0"
}
]
},
@ -178,8 +205,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object"
"type": "object",
"$id": "type_3_0"
}
]
},
@ -187,37 +214,44 @@
{
"description": "an integer is not an object",
"data": 1,
"valid": false
"valid": false,
"schema_id": "type_3_0"
},
{
"description": "a float is not an object",
"data": 1.1,
"valid": false
"valid": false,
"schema_id": "type_3_0"
},
{
"description": "a string is not an object",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "type_3_0"
},
{
"description": "an object is an object",
"data": {},
"valid": true
"valid": true,
"schema_id": "type_3_0"
},
{
"description": "an array is not an object",
"data": [],
"valid": false
"valid": false,
"schema_id": "type_3_0"
},
{
"description": "a boolean is not an object",
"data": true,
"valid": false
"valid": false,
"schema_id": "type_3_0"
},
{
"description": "null is not an object",
"data": null,
"valid": false
"valid": false,
"schema_id": "type_3_0"
}
]
},
@ -226,8 +260,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "array"
"type": "array",
"$id": "type_4_0"
}
]
},
@ -235,37 +269,44 @@
{
"description": "an integer is not an array",
"data": 1,
"valid": false
"valid": false,
"schema_id": "type_4_0"
},
{
"description": "a float is not an array",
"data": 1.1,
"valid": false
"valid": false,
"schema_id": "type_4_0"
},
{
"description": "a string is not an array",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "type_4_0"
},
{
"description": "an object is not an array",
"data": {},
"valid": false
"valid": false,
"schema_id": "type_4_0"
},
{
"description": "an array is an array",
"data": [],
"valid": true
"valid": true,
"schema_id": "type_4_0"
},
{
"description": "a boolean is not an array",
"data": true,
"valid": false
"valid": false,
"schema_id": "type_4_0"
},
{
"description": "null is not an array",
"data": null,
"valid": false
"valid": false,
"schema_id": "type_4_0"
}
]
},
@ -274,8 +315,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "boolean"
"type": "boolean",
"$id": "type_5_0"
}
]
},
@ -283,52 +324,62 @@
{
"description": "an integer is not a boolean",
"data": 1,
"valid": false
"valid": false,
"schema_id": "type_5_0"
},
{
"description": "zero is not a boolean",
"data": 0,
"valid": false
"valid": false,
"schema_id": "type_5_0"
},
{
"description": "a float is not a boolean",
"data": 1.1,
"valid": false
"valid": false,
"schema_id": "type_5_0"
},
{
"description": "a string is not a boolean",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "type_5_0"
},
{
"description": "an empty string is a null",
"data": "",
"valid": true
"valid": true,
"schema_id": "type_5_0"
},
{
"description": "an object is not a boolean",
"data": {},
"valid": false
"valid": false,
"schema_id": "type_5_0"
},
{
"description": "an array is not a boolean",
"data": [],
"valid": false
"valid": false,
"schema_id": "type_5_0"
},
{
"description": "true is a boolean",
"data": true,
"valid": true
"valid": true,
"schema_id": "type_5_0"
},
{
"description": "false is a boolean",
"data": false,
"valid": true
"valid": true,
"schema_id": "type_5_0"
},
{
"description": "null is not a boolean",
"data": null,
"valid": false
"valid": false,
"schema_id": "type_5_0"
}
]
},
@ -337,8 +388,8 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "null"
"type": "null",
"$id": "type_6_0"
}
]
},
@ -346,52 +397,62 @@
{
"description": "an integer is not null",
"data": 1,
"valid": false
"valid": false,
"schema_id": "type_6_0"
},
{
"description": "a float is not null",
"data": 1.1,
"valid": false
"valid": false,
"schema_id": "type_6_0"
},
{
"description": "zero is not null",
"data": 0,
"valid": false
"valid": false,
"schema_id": "type_6_0"
},
{
"description": "a string is not null",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "type_6_0"
},
{
"description": "an empty string is null",
"data": "",
"valid": true
"valid": true,
"schema_id": "type_6_0"
},
{
"description": "an object is not null",
"data": {},
"valid": false
"valid": false,
"schema_id": "type_6_0"
},
{
"description": "an array is not null",
"data": [],
"valid": false
"valid": false,
"schema_id": "type_6_0"
},
{
"description": "true is not null",
"data": true,
"valid": false
"valid": false,
"schema_id": "type_6_0"
},
{
"description": "false is not null",
"data": false,
"valid": false
"valid": false,
"schema_id": "type_6_0"
},
{
"description": "null is null",
"data": null,
"valid": true
"valid": true,
"schema_id": "type_6_0"
}
]
},
@ -400,11 +461,11 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": [
"integer",
"string"
]
],
"$id": "type_7_0"
}
]
},
@ -412,37 +473,44 @@
{
"description": "an integer is valid",
"data": 1,
"valid": true
"valid": true,
"schema_id": "type_7_0"
},
{
"description": "a string is valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "type_7_0"
},
{
"description": "a float is invalid",
"data": 1.1,
"valid": false
"valid": false,
"schema_id": "type_7_0"
},
{
"description": "an object is invalid",
"data": {},
"valid": false
"valid": false,
"schema_id": "type_7_0"
},
{
"description": "an array is invalid",
"data": [],
"valid": false
"valid": false,
"schema_id": "type_7_0"
},
{
"description": "a boolean is invalid",
"data": true,
"valid": false
"valid": false,
"schema_id": "type_7_0"
},
{
"description": "null is invalid",
"data": null,
"valid": false
"valid": false,
"schema_id": "type_7_0"
}
]
},
@ -451,10 +519,10 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": [
"string"
]
],
"$id": "type_8_0"
}
]
},
@ -462,12 +530,14 @@
{
"description": "string is valid",
"data": "foo",
"valid": true
"valid": true,
"schema_id": "type_8_0"
},
{
"description": "number is invalid",
"data": 123,
"valid": false
"valid": false,
"schema_id": "type_8_0"
}
]
},
@ -476,12 +546,12 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": [
"array",
"object"
],
"items": {}
"items": {},
"$id": "type_9_0"
}
]
},
@ -493,27 +563,32 @@
2,
3
],
"valid": true
"valid": true,
"schema_id": "type_9_0"
},
{
"description": "object is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "type_9_0"
},
{
"description": "number is invalid",
"data": 123,
"valid": false
"valid": false,
"schema_id": "type_9_0"
},
{
"description": "string is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "type_9_0"
},
{
"description": "null is invalid",
"data": null,
"valid": false
"valid": false,
"schema_id": "type_9_0"
}
]
},
@ -522,13 +597,13 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": [
"array",
"object",
"null"
],
"items": {}
"items": {},
"$id": "type_10_0"
}
]
},
@ -540,27 +615,32 @@
2,
3
],
"valid": true
"valid": true,
"schema_id": "type_10_0"
},
{
"description": "object is valid",
"data": {},
"valid": true
"valid": true,
"schema_id": "type_10_0"
},
{
"description": "null is valid",
"data": null,
"valid": true
"valid": true,
"schema_id": "type_10_0"
},
{
"description": "number is invalid",
"data": 123,
"valid": false
"valid": false,
"schema_id": "type_10_0"
},
{
"description": "string is invalid",
"data": "foo",
"valid": false
"valid": false,
"schema_id": "type_10_0"
}
]
},
@ -569,9 +649,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"extensible": true
"extensible": true,
"$id": "type_11_0"
}
]
},
@ -581,7 +661,8 @@
"data": {
"foo": 1
},
"valid": true
"valid": true,
"schema_id": "type_11_0"
}
]
}

View File

@ -1,343 +0,0 @@
[
{
"description": "Entities extending entities",
"database": {
"types": [
{
"name": "entity",
"hierarchy": [
"entity"
],
"schemas": [
{
"$id": "entity",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"const": "entity"
}
}
}
]
},
{
"name": "organization",
"hierarchy": [
"entity",
"organization"
],
"schemas": [
{
"$id": "organization",
"$ref": "entity",
"properties": {
"name": {
"type": "string"
}
}
}
]
},
{
"name": "person",
"hierarchy": [
"entity",
"organization",
"person"
],
"schemas": [
{
"$id": "person",
"$ref": "organization",
"properties": {
"first_name": {
"type": "string"
}
}
}
]
}
],
"puncs": [
{
"name": "save_org",
"schemas": [
{
"$id": "save_org.request",
"$ref": "organization"
}
]
}
]
},
"tests": [
{
"description": "Valid person against organization schema (implicit type allowance)",
"schema_id": "save_org.request",
"data": {
"id": "1",
"type": "person",
"name": "ACME"
},
"valid": true
},
{
"description": "Valid organization against organization schema",
"schema_id": "save_org.request",
"data": {
"id": "2",
"type": "organization",
"name": "ACME"
},
"valid": true
},
{
"description": "Invalid entity against organization schema (ancestor not allowed)",
"schema_id": "save_org.request",
"data": {
"id": "3",
"type": "entity"
},
"valid": false
},
{
"description": "Invalid generic type against organization schema",
"schema_id": "save_org.request",
"data": {
"id": "4",
"type": "generic_thing"
},
"valid": false
}
]
},
{
"description": "Ad-hocs extending entities (still entities with type magic)",
"database": {
"types": [
{
"name": "entity",
"hierarchy": [
"entity"
],
"schemas": [
{
"$id": "entity",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"const": "entity"
}
}
}
]
},
{
"name": "person",
"hierarchy": [
"entity",
"person"
],
"schemas": [
{
"$id": "person",
"$ref": "entity",
"properties": {
"first_name": {
"type": "string"
}
}
}
]
}
],
"puncs": [
{
"name": "save_person_light",
"schemas": [
{
"$id": "person.light",
"$ref": "person",
"extensible": false,
"properties": {
"first_name": {
"type": "string"
}
}
},
{
"$id": "save_person_light.request",
"$ref": "person.light"
}
]
}
]
},
"tests": [
{
"description": "Valid person against person.light ad-hoc schema",
"schema_id": "save_person_light.request",
"data": {
"id": "1",
"type": "person",
"first_name": "John"
},
"valid": true
},
{
"description": "Invalid person against person.light (strictness violation)",
"schema_id": "save_person_light.request",
"data": {
"id": "1",
"type": "person",
"first_name": "John",
"extra": "bad"
},
"valid": false
},
{
"description": "Invalid entity against person.light ad-hoc schema (ancestor not allowed)",
"schema_id": "save_person_light.request",
"data": {
"id": "1",
"type": "entity",
"first_name": "John"
},
"valid": false
}
]
},
{
"description": "Ad-hocs extending ad-hocs (No type property)",
"database": {
"puncs": [
{
"name": "save_address",
"schemas": [
{
"$id": "address",
"type": "object",
"properties": {
"street": {
"type": "string"
},
"city": {
"type": "string"
}
}
},
{
"$id": "us_address",
"$ref": "address",
"properties": {
"state": {
"type": "string"
},
"zip": {
"type": "string"
}
}
},
{
"$id": "save_address.request",
"$ref": "us_address"
}
]
}
]
},
"tests": [
{
"description": "Valid us_address",
"schema_id": "save_address.request",
"data": {
"street": "123 Main",
"city": "Anytown",
"state": "CA",
"zip": "12345"
},
"valid": true
},
{
"description": "Invalid base address against us_address",
"schema_id": "save_address.request",
"data": {
"street": "123 Main",
"city": "Anytown"
},
"valid": true
}
]
},
{
"description": "Ad-hocs extending ad-hocs (with string type property, no magic)",
"database": {
"puncs": [
{
"name": "save_config",
"schemas": [
{
"$id": "config_base",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "config_base"
},
"setting": {
"type": "string"
}
}
},
{
"$id": "config_advanced",
"$ref": "config_base",
"properties": {
"type": {
"type": "string",
"const": "config_advanced"
},
"advanced_setting": {
"type": "string"
}
}
},
{
"$id": "save_config.request",
"$ref": "config_base"
}
]
}
]
},
"tests": [
{
"description": "Valid config_base against config_base",
"schema_id": "save_config.request",
"data": {
"type": "config_base",
"setting": "on"
},
"valid": true
},
{
"description": "Invalid config_advanced against config_base (no type magic, const is strictly 'config_base')",
"schema_id": "save_config.request",
"data": {
"type": "config_advanced",
"setting": "on",
"advanced_setting": "off"
},
"valid": false
}
]
}
]

View File

@ -4,9 +4,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"uniqueItems": true,
"extensible": true
"extensible": true,
"$id": "uniqueItems_0_0"
}
]
},
@ -17,7 +17,8 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "non-unique array of integers is invalid",
@ -25,7 +26,8 @@
1,
1
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_0_0"
},
{
"description": "non-unique array of more than two integers is invalid",
@ -34,16 +36,18 @@
2,
1
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_0_0"
},
{
"description": "numbers are unique if mathematically unequal",
"data": [
1.0,
1.00,
1,
1,
1
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_0_0"
},
{
"description": "false is not equal to zero",
@ -51,7 +55,8 @@
0,
false
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "true is not equal to one",
@ -59,7 +64,8 @@
1,
true
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "unique array of strings is valid",
@ -68,7 +74,8 @@
"bar",
"baz"
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "non-unique array of strings is invalid",
@ -77,7 +84,8 @@
"bar",
"foo"
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_0_0"
},
{
"description": "unique array of objects is valid",
@ -89,7 +97,8 @@
"foo": "baz"
}
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "non-unique array of objects is invalid",
@ -101,7 +110,8 @@
"foo": "bar"
}
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_0_0"
},
{
"description": "property order of array of objects is ignored",
@ -115,7 +125,8 @@
"foo": "bar"
}
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_0_0"
},
{
"description": "unique array of nested objects is valid",
@ -135,7 +146,8 @@
}
}
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "non-unique array of nested objects is invalid",
@ -155,7 +167,8 @@
}
}
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_0_0"
},
{
"description": "unique array of arrays is valid",
@ -167,7 +180,8 @@
"bar"
]
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "non-unique array of arrays is invalid",
@ -179,7 +193,8 @@
"foo"
]
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_0_0"
},
{
"description": "non-unique array of more than two arrays is invalid",
@ -194,7 +209,8 @@
"foo"
]
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_0_0"
},
{
"description": "1 and true are unique",
@ -202,7 +218,8 @@
1,
true
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "0 and false are unique",
@ -210,7 +227,8 @@
0,
false
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "[1] and [true] are unique",
@ -222,7 +240,8 @@
true
]
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "[0] and [false] are unique",
@ -234,7 +253,8 @@
false
]
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "nested [1] and [true] are unique",
@ -252,7 +272,8 @@
"foo"
]
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "nested [0] and [false] are unique",
@ -270,7 +291,8 @@
"foo"
]
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "unique heterogeneous types are valid",
@ -284,7 +306,8 @@
1,
"{}"
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "non-unique heterogeneous types are invalid",
@ -298,7 +321,8 @@
{},
1
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_0_0"
},
{
"description": "different objects are unique",
@ -312,7 +336,8 @@
"b": 1
}
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "objects are non-unique despite key order",
@ -326,7 +351,8 @@
"a": 1
}
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_0_0"
},
{
"description": "{\"a\": false} and {\"a\": 0} are unique",
@ -338,7 +364,8 @@
"a": 0
}
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
},
{
"description": "{\"a\": true} and {\"a\": 1} are unique",
@ -350,7 +377,8 @@
"a": 1
}
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_0_0"
}
]
},
@ -359,7 +387,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{
"type": "boolean"
@ -369,7 +396,8 @@
}
],
"uniqueItems": true,
"extensible": true
"extensible": true,
"$id": "uniqueItems_1_0"
}
]
},
@ -380,7 +408,8 @@
false,
true
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_1_0"
},
{
"description": "[true, false] from items array is valid",
@ -388,7 +417,8 @@
true,
false
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_1_0"
},
{
"description": "[false, false] from items array is not valid",
@ -396,7 +426,8 @@
false,
false
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_1_0"
},
{
"description": "[true, true] from items array is not valid",
@ -404,7 +435,8 @@
true,
true
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_1_0"
},
{
"description": "unique array extended from [false, true] is valid",
@ -414,7 +446,8 @@
"foo",
"bar"
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_1_0"
},
{
"description": "unique array extended from [true, false] is valid",
@ -424,7 +457,8 @@
"foo",
"bar"
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_1_0"
},
{
"description": "non-unique array extended from [false, true] is not valid",
@ -434,7 +468,8 @@
"foo",
"foo"
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_1_0"
},
{
"description": "non-unique array extended from [true, false] is not valid",
@ -444,7 +479,8 @@
"foo",
"foo"
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_1_0"
}
]
},
@ -453,7 +489,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{
"type": "boolean"
@ -463,7 +498,8 @@
}
],
"uniqueItems": true,
"items": false
"items": false,
"$id": "uniqueItems_2_0"
}
]
},
@ -474,7 +510,8 @@
false,
true
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_2_0"
},
{
"description": "[true, false] from items array is valid",
@ -482,7 +519,8 @@
true,
false
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_2_0"
},
{
"description": "[false, false] from items array is not valid",
@ -490,7 +528,8 @@
false,
false
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_2_0"
},
{
"description": "[true, true] from items array is not valid",
@ -498,7 +537,8 @@
true,
true
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_2_0"
},
{
"description": "extra items are invalid even if unique",
@ -507,7 +547,8 @@
true,
null
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_2_0"
}
]
},
@ -516,9 +557,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"uniqueItems": false,
"extensible": true
"extensible": true,
"$id": "uniqueItems_3_0"
}
]
},
@ -529,7 +570,8 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "non-unique array of integers is valid",
@ -537,16 +579,18 @@
1,
1
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "numbers are unique if mathematically unequal",
"data": [
1.0,
1.00,
1,
1,
1
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "false is not equal to zero",
@ -554,7 +598,8 @@
0,
false
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "true is not equal to one",
@ -562,7 +607,8 @@
1,
true
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "unique array of objects is valid",
@ -574,7 +620,8 @@
"foo": "baz"
}
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "non-unique array of objects is valid",
@ -586,7 +633,8 @@
"foo": "bar"
}
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "unique array of nested objects is valid",
@ -606,7 +654,8 @@
}
}
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "non-unique array of nested objects is valid",
@ -626,7 +675,8 @@
}
}
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "unique array of arrays is valid",
@ -638,7 +688,8 @@
"bar"
]
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "non-unique array of arrays is valid",
@ -650,7 +701,8 @@
"foo"
]
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "1 and true are unique",
@ -658,7 +710,8 @@
1,
true
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "0 and false are unique",
@ -666,7 +719,8 @@
0,
false
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "unique heterogeneous types are valid",
@ -679,7 +733,8 @@
null,
1
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
},
{
"description": "non-unique heterogeneous types are valid",
@ -693,7 +748,8 @@
{},
1
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_3_0"
}
]
},
@ -702,7 +758,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{
"type": "boolean"
@ -712,7 +767,8 @@
}
],
"uniqueItems": false,
"extensible": true
"extensible": true,
"$id": "uniqueItems_4_0"
}
]
},
@ -723,7 +779,8 @@
false,
true
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_4_0"
},
{
"description": "[true, false] from items array is valid",
@ -731,7 +788,8 @@
true,
false
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_4_0"
},
{
"description": "[false, false] from items array is valid",
@ -739,7 +797,8 @@
false,
false
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_4_0"
},
{
"description": "[true, true] from items array is valid",
@ -747,7 +806,8 @@
true,
true
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_4_0"
},
{
"description": "unique array extended from [false, true] is valid",
@ -757,7 +817,8 @@
"foo",
"bar"
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_4_0"
},
{
"description": "unique array extended from [true, false] is valid",
@ -767,7 +828,8 @@
"foo",
"bar"
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_4_0"
},
{
"description": "non-unique array extended from [false, true] is valid",
@ -777,7 +839,8 @@
"foo",
"foo"
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_4_0"
},
{
"description": "non-unique array extended from [true, false] is valid",
@ -787,7 +850,8 @@
"foo",
"foo"
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_4_0"
}
]
},
@ -796,7 +860,6 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{
"type": "boolean"
@ -806,7 +869,8 @@
}
],
"uniqueItems": false,
"items": false
"items": false,
"$id": "uniqueItems_5_0"
}
]
},
@ -817,7 +881,8 @@
false,
true
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_5_0"
},
{
"description": "[true, false] from items array is valid",
@ -825,7 +890,8 @@
true,
false
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_5_0"
},
{
"description": "[false, false] from items array is valid",
@ -833,7 +899,8 @@
false,
false
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_5_0"
},
{
"description": "[true, true] from items array is valid",
@ -841,7 +908,8 @@
true,
true
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_5_0"
},
{
"description": "extra items are invalid even if unique",
@ -850,7 +918,8 @@
true,
null
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_5_0"
}
]
},
@ -859,9 +928,9 @@
"database": {
"schemas": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"uniqueItems": true,
"extensible": true
"extensible": true,
"$id": "uniqueItems_6_0"
}
]
},
@ -872,7 +941,8 @@
1,
1
],
"valid": false
"valid": false,
"schema_id": "uniqueItems_6_0"
},
{
"description": "extra unique items valid",
@ -880,7 +950,8 @@
1,
2
],
"valid": true
"valid": true,
"schema_id": "uniqueItems_6_0"
}
]
}