Skip to content

Commit 34a2dfa

Browse files
committed
Add nested allOf, oneOf tests
1 parent b70c562 commit 34a2dfa

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

tests/draft2019-09/allOf.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,5 +214,31 @@
214214
"valid": false
215215
}
216216
]
217+
},
218+
{
219+
"description": "nested allOf, to check validation semantics",
220+
"schema": {
221+
"allOf": [
222+
{
223+
"allOf": [
224+
{
225+
"type": "null"
226+
}
227+
]
228+
}
229+
]
230+
},
231+
"tests": [
232+
{
233+
"description": "null is valid",
234+
"data": null,
235+
"valid": true
236+
},
237+
{
238+
"description": "anything non-null is invalid",
239+
"data": 123,
240+
"valid": false
241+
}
242+
]
217243
}
218244
]

tests/draft2019-09/oneOf.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,5 +244,31 @@
244244
"valid": false
245245
}
246246
]
247+
},
248+
{
249+
"description": "nested oneOf, to check validation semantics",
250+
"schema": {
251+
"oneOf": [
252+
{
253+
"oneOf": [
254+
{
255+
"type": "null"
256+
}
257+
]
258+
}
259+
]
260+
},
261+
"tests": [
262+
{
263+
"description": "null is valid",
264+
"data": null,
265+
"valid": true
266+
},
267+
{
268+
"description": "anything non-null is invalid",
269+
"data": 123,
270+
"valid": false
271+
}
272+
]
247273
}
248274
]

0 commit comments

Comments
 (0)