Skip to content

Commit d62b754

Browse files
committed
draft-06: allOf, anyOf, oneOf keywords with boolean schemas
1 parent b714a18 commit d62b754

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed

tests/draft6/allOf.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,38 @@
108108
"valid": false
109109
}
110110
]
111+
},
112+
{
113+
"description": "allOf with boolean schemas, all true",
114+
"schema": {"allOf": [true, true]},
115+
"tests": [
116+
{
117+
"description": "any value is valid",
118+
"data": "foo",
119+
"valid": true
120+
}
121+
]
122+
},
123+
{
124+
"description": "allOf with boolean schemas, some false",
125+
"schema": {"allOf": [true, false]},
126+
"tests": [
127+
{
128+
"description": "any value is invalid",
129+
"data": "foo",
130+
"valid": false
131+
}
132+
]
133+
},
134+
{
135+
"description": "allOf with boolean schemas, all false",
136+
"schema": {"allOf": [false, false]},
137+
"tests": [
138+
{
139+
"description": "any value is invalid",
140+
"data": "foo",
141+
"valid": false
142+
}
143+
]
111144
}
112145
]

tests/draft6/anyOf.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,38 @@
6464
"valid": false
6565
}
6666
]
67+
},
68+
{
69+
"description": "anyOf with boolean schemas, all true",
70+
"schema": {"anyOf": [true, true]},
71+
"tests": [
72+
{
73+
"description": "any value is valid",
74+
"data": "foo",
75+
"valid": true
76+
}
77+
]
78+
},
79+
{
80+
"description": "anyOf with boolean schemas, some true",
81+
"schema": {"anyOf": [true, false]},
82+
"tests": [
83+
{
84+
"description": "any value is valid",
85+
"data": "foo",
86+
"valid": true
87+
}
88+
]
89+
},
90+
{
91+
"description": "anyOf with boolean schemas, all false",
92+
"schema": {"anyOf": [false, false]},
93+
"tests": [
94+
{
95+
"description": "any value is invalid",
96+
"data": "foo",
97+
"valid": false
98+
}
99+
]
67100
}
68101
]

tests/draft6/oneOf.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,49 @@
6464
"valid": false
6565
}
6666
]
67+
},
68+
{
69+
"description": "oneOf with boolean schemas, all true",
70+
"schema": {"oneOf": [true, true, true]},
71+
"tests": [
72+
{
73+
"description": "any value is invalid",
74+
"data": "foo",
75+
"valid": false
76+
}
77+
]
78+
},
79+
{
80+
"description": "oneOf with boolean schemas, one true",
81+
"schema": {"oneOf": [true, false, false]},
82+
"tests": [
83+
{
84+
"description": "any value is valid",
85+
"data": "foo",
86+
"valid": true
87+
}
88+
]
89+
},
90+
{
91+
"description": "oneOf with boolean schemas, more than one true",
92+
"schema": {"oneOf": [true, true, false]},
93+
"tests": [
94+
{
95+
"description": "any value is invalid",
96+
"data": "foo",
97+
"valid": false
98+
}
99+
]
100+
},
101+
{
102+
"description": "oneOf with boolean schemas, all false",
103+
"schema": {"oneOf": [false, false, false]},
104+
"tests": [
105+
{
106+
"description": "any value is invalid",
107+
"data": "foo",
108+
"valid": false
109+
}
110+
]
67111
}
68112
]

0 commit comments

Comments
 (0)