Skip to content

Commit

Permalink
test when $dynamicRef references a boolean schema
Browse files Browse the repository at this point in the history
  • Loading branch information
karenetheridge committed Nov 13, 2023
1 parent 95fe6ca commit ad51b5c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/draft-next/dynamicRef.json
Original file line number Diff line number Diff line change
Expand Up @@ -612,5 +612,31 @@
"valid": false
}
]
},
{
"description": "$dynamicRef points to a boolean schema",
"schema": {
"$defs": {
"boolean": true
},
"properties": {
"true": {
"$dynamicRef": "#/$defs/boolean"
},
"false": false
}
},
"tests": [
{
"description": "follow $dynamicRef to a true schema",
"data": { "true": 1 },
"valid": true
},
{
"description": "false schema",
"data": { "false": 1 },
"valid": false
}
]
}
]
26 changes: 26 additions & 0 deletions tests/draft2020-12/dynamicRef.json
Original file line number Diff line number Diff line change
Expand Up @@ -726,5 +726,31 @@
"valid": false
}
]
},
{
"description": "$dynamicRef points to a boolean schema",
"schema": {
"$defs": {
"boolean": true
},
"properties": {
"true": {
"$dynamicRef": "#/$defs/boolean"
},
"false": false
}
},
"tests": [
{
"description": "follow $dynamicRef to a true schema",
"data": { "true": 1 },
"valid": true
},
{
"description": "false schema",
"data": { "false": 1 },
"valid": false
}
]
}
]

0 comments on commit ad51b5c

Please sign in to comment.