Skip to content

Commit ad51b5c

Browse files
test when $dynamicRef references a boolean schema
1 parent 95fe6ca commit ad51b5c

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

tests/draft-next/dynamicRef.json

+26
Original file line numberDiff line numberDiff line change
@@ -612,5 +612,31 @@
612612
"valid": false
613613
}
614614
]
615+
},
616+
{
617+
"description": "$dynamicRef points to a boolean schema",
618+
"schema": {
619+
"$defs": {
620+
"boolean": true
621+
},
622+
"properties": {
623+
"true": {
624+
"$dynamicRef": "#/$defs/boolean"
625+
},
626+
"false": false
627+
}
628+
},
629+
"tests": [
630+
{
631+
"description": "follow $dynamicRef to a true schema",
632+
"data": { "true": 1 },
633+
"valid": true
634+
},
635+
{
636+
"description": "false schema",
637+
"data": { "false": 1 },
638+
"valid": false
639+
}
640+
]
615641
}
616642
]

tests/draft2020-12/dynamicRef.json

+26
Original file line numberDiff line numberDiff line change
@@ -726,5 +726,31 @@
726726
"valid": false
727727
}
728728
]
729+
},
730+
{
731+
"description": "$dynamicRef points to a boolean schema",
732+
"schema": {
733+
"$defs": {
734+
"boolean": true
735+
},
736+
"properties": {
737+
"true": {
738+
"$dynamicRef": "#/$defs/boolean"
739+
},
740+
"false": false
741+
}
742+
},
743+
"tests": [
744+
{
745+
"description": "follow $dynamicRef to a true schema",
746+
"data": { "true": 1 },
747+
"valid": true
748+
},
749+
{
750+
"description": "false schema",
751+
"data": { "false": 1 },
752+
"valid": false
753+
}
754+
]
729755
}
730756
]

0 commit comments

Comments
 (0)