jspg progress

This commit is contained in:
2026-02-17 17:41:54 -05:00
parent 6e06b6fdc2
commit 32ed463df8
188 changed files with 36654 additions and 15058 deletions

128
tests/fixtures/old/override.json vendored Normal file
View File

@ -0,0 +1,128 @@
[
{
"description": "override: true replaces base property definition",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"base": {
"properties": {
"foo": {
"type": "string",
"minLength": 5
}
}
}
},
"$ref": "#/$defs/base",
"properties": {
"foo": {
"type": "integer",
"override": true
}
}
},
"tests": [
{
"description": "valid integer (overrides string type)",
"data": {
"foo": 123
},
"valid": true
},
{
"description": "invalid integer (overrides string type)",
"data": {
"foo": "abc"
},
"valid": false
}
]
},
{
"description": "override: true in nested schema",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"base": {
"properties": {
"config": {
"properties": {
"mode": {
"const": "auto"
}
}
}
}
}
},
"$ref": "#/$defs/base",
"properties": {
"config": {
"properties": {
"mode": {
"const": "manual",
"override": true
}
}
}
}
},
"tests": [
{
"description": "matches overridden const",
"data": {
"config": {
"mode": "manual"
}
},
"valid": true
},
{
"description": "does not match base const",
"data": {
"config": {
"mode": "auto"
}
},
"valid": false
}
]
},
{
"description": "override: false (default) behavior (intersection)",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"base": {
"properties": {
"foo": {
"type": "string"
}
}
}
},
"$ref": "#/$defs/base",
"properties": {
"foo": {
"minLength": 2
}
}
},
"tests": [
{
"description": "valid intersection",
"data": {
"foo": "ok"
},
"valid": true
},
{
"description": "invalid intersection (wrong type)",
"data": {
"foo": 123
},
"valid": false
}
]
}
]