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,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"
}
]
}