Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions tests/draft2020-12/optional/cross-draft.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,32 @@
"valid": true
}
]
},
{
"description": "$schema after $defs still sets the dialect for $defs",
"comment": "keyword order is insignificant, so the dialect from $schema applies to subschemas in $defs even though $defs appears before $schema; prefixItems is not a keyword in 2019-09 and is therefore ignored",
"schema": {
"$defs": {
"list": {
"prefixItems": [{ "type": "string" }],
"minItems": 2
}
},
"$ref": "#/$defs/list",
"$schema": "https://json-schema.org/draft/2019-09/schema"
},
"tests": [
{
"description": "non-string first item is valid",
"comment": "if $defs is built with the default dialect rather than the one from $schema, prefixItems forces the first item to be a string and this fails",
"data": [1, 2, 3],
"valid": true
},
{
"description": "too few items is invalid",
"data": [1],
"valid": false
}
]
}
]
Loading