Skip to content

Commit e8667b6

Browse files
authored
reproduce incorrect allOf + nullable behaviour (#253)
1 parent fa7ca86 commit e8667b6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

openapi3/schema_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,32 @@ var schemaExamples = []schemaExample{
204204
},
205205
},
206206

207+
{
208+
Title: "NULLABLE ALLOF",
209+
Schema: NewAllOfSchema(
210+
NewBoolSchema().WithNullable(),
211+
NewBoolSchema().WithNullable(),
212+
),
213+
Serialization: map[string]interface{}{
214+
"allOf": []interface{}{
215+
map[string]interface{}{"type": "boolean", "nullable": true},
216+
map[string]interface{}{"type": "boolean", "nullable": true},
217+
},
218+
},
219+
AllValid: []interface{}{
220+
nil,
221+
true,
222+
false,
223+
},
224+
AllInvalid: []interface{}{
225+
2,
226+
4.2,
227+
[]interface{}{42},
228+
"bla",
229+
map[string]interface{}{},
230+
},
231+
},
232+
207233
{
208234
Title: "BOOLEAN",
209235
Schema: NewBoolSchema(),

0 commit comments

Comments
 (0)