diff --git a/openapi3/schema_test.go b/openapi3/schema_test.go index 43133c777..1ea859780 100644 --- a/openapi3/schema_test.go +++ b/openapi3/schema_test.go @@ -204,6 +204,32 @@ var schemaExamples = []schemaExample{ }, }, + { + Title: "NULLABLE ALLOF", + Schema: NewAllOfSchema( + NewBoolSchema().WithNullable(), + NewBoolSchema().WithNullable(), + ), + Serialization: map[string]interface{}{ + "allOf": []interface{}{ + map[string]interface{}{"type": "boolean", "nullable": true}, + map[string]interface{}{"type": "boolean", "nullable": true}, + }, + }, + AllValid: []interface{}{ + nil, + true, + false, + }, + AllInvalid: []interface{}{ + 2, + 4.2, + []interface{}{42}, + "bla", + map[string]interface{}{}, + }, + }, + { Title: "BOOLEAN", Schema: NewBoolSchema(),