File tree Expand file tree Collapse file tree 3 files changed +129
-6
lines changed Expand file tree Collapse file tree 3 files changed +129
-6
lines changed Original file line number Diff line number Diff line change 115
115
"oneOf" : [
116
116
{
117
117
"properties" : {
118
- "bar" : {"type" : " integer" },
119
- "baz" : {"type" : " integer" }
118
+ "bar" : {"type" : " integer" }
120
119
},
121
120
"required" : [" bar" ]
122
121
},
203
202
"valid" : false
204
203
}
205
204
]
205
+ },
206
+ {
207
+ "description" : " oneOf with missing optional property" ,
208
+ "schema" : {
209
+ "oneOf" : [
210
+ {
211
+ "properties" : {
212
+ "bar" : true ,
213
+ "baz" : true
214
+ },
215
+ "required" : [" bar" ]
216
+ },
217
+ {
218
+ "properties" : {
219
+ "foo" : true
220
+ },
221
+ "required" : [" foo" ]
222
+ }
223
+ ]
224
+ },
225
+ "tests" : [
226
+ {
227
+ "description" : " first oneOf valid" ,
228
+ "data" : {"bar" : 8 },
229
+ "valid" : true
230
+ },
231
+ {
232
+ "description" : " second oneOf valid" ,
233
+ "data" : {"foo" : " foo" },
234
+ "valid" : true
235
+ },
236
+ {
237
+ "description" : " both oneOf valid" ,
238
+ "data" : {"foo" : " foo" , "bar" : 8 },
239
+ "valid" : false
240
+ },
241
+ {
242
+ "description" : " neither oneOf valid" ,
243
+ "data" : {"baz" : " quux" },
244
+ "valid" : false
245
+ }
246
+ ]
206
247
}
207
248
]
Original file line number Diff line number Diff line change 115
115
"oneOf" : [
116
116
{
117
117
"properties" : {
118
- "bar" : {"type" : " integer" },
119
- "baz" : {"type" : " integer" }
118
+ "bar" : {"type" : " integer" }
120
119
},
121
120
"required" : [" bar" ]
122
121
},
203
202
"valid" : false
204
203
}
205
204
]
205
+ },
206
+ {
207
+ "description" : " oneOf with missing optional property" ,
208
+ "schema" : {
209
+ "oneOf" : [
210
+ {
211
+ "properties" : {
212
+ "bar" : true ,
213
+ "baz" : true
214
+ },
215
+ "required" : [" bar" ]
216
+ },
217
+ {
218
+ "properties" : {
219
+ "foo" : true
220
+ },
221
+ "required" : [" foo" ]
222
+ }
223
+ ]
224
+ },
225
+ "tests" : [
226
+ {
227
+ "description" : " first oneOf valid" ,
228
+ "data" : {"bar" : 8 },
229
+ "valid" : true
230
+ },
231
+ {
232
+ "description" : " second oneOf valid" ,
233
+ "data" : {"foo" : " foo" },
234
+ "valid" : true
235
+ },
236
+ {
237
+ "description" : " both oneOf valid" ,
238
+ "data" : {"foo" : " foo" , "bar" : 8 },
239
+ "valid" : false
240
+ },
241
+ {
242
+ "description" : " neither oneOf valid" ,
243
+ "data" : {"baz" : " quux" },
244
+ "valid" : false
245
+ }
246
+ ]
206
247
}
207
248
]
Original file line number Diff line number Diff line change 115
115
"oneOf" : [
116
116
{
117
117
"properties" : {
118
- "bar" : {"type" : " integer" },
119
- "baz" : {"type" : " integer" }
118
+ "bar" : {"type" : " integer" }
120
119
},
121
120
"required" : [" bar" ]
122
121
},
203
202
"valid" : false
204
203
}
205
204
]
205
+ },
206
+ {
207
+ "description" : " oneOf with missing optional property" ,
208
+ "schema" : {
209
+ "oneOf" : [
210
+ {
211
+ "properties" : {
212
+ "bar" : true ,
213
+ "baz" : true
214
+ },
215
+ "required" : [" bar" ]
216
+ },
217
+ {
218
+ "properties" : {
219
+ "foo" : true
220
+ },
221
+ "required" : [" foo" ]
222
+ }
223
+ ]
224
+ },
225
+ "tests" : [
226
+ {
227
+ "description" : " first oneOf valid" ,
228
+ "data" : {"bar" : 8 },
229
+ "valid" : true
230
+ },
231
+ {
232
+ "description" : " second oneOf valid" ,
233
+ "data" : {"foo" : " foo" },
234
+ "valid" : true
235
+ },
236
+ {
237
+ "description" : " both oneOf valid" ,
238
+ "data" : {"foo" : " foo" , "bar" : 8 },
239
+ "valid" : false
240
+ },
241
+ {
242
+ "description" : " neither oneOf valid" ,
243
+ "data" : {"baz" : " quux" },
244
+ "valid" : false
245
+ }
246
+ ]
206
247
}
207
248
]
You can’t perform that action at this time.
0 commit comments