81 lines
2.2 KiB
JSON
Executable File
81 lines
2.2 KiB
JSON
Executable File
[
|
|
{
|
|
"description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop",
|
|
"schema": {
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$defs": {
|
|
"int": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"properties": {
|
|
"foo": {
|
|
"$ref": "#/$defs/int"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"additionalProperties": {
|
|
"$ref": "#/$defs/int"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "passing case",
|
|
"data": {
|
|
"foo": 1
|
|
},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "failing case",
|
|
"data": {
|
|
"foo": "a string"
|
|
},
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "guard against infinite recursion",
|
|
"schema": {
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$defs": {
|
|
"alice": {
|
|
"$anchor": "alice",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#bob"
|
|
}
|
|
]
|
|
},
|
|
"bob": {
|
|
"$anchor": "bob",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#alice"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"$ref": "#alice"
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "infinite recursion detected",
|
|
"data": {},
|
|
"valid": false,
|
|
"expect_errors": [
|
|
{
|
|
"code": "MAX_DEPTH_REACHED",
|
|
"path": ""
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
] |