Skip to content

Commit

Permalink
reproduce incorrect allOf + nullable behaviour (getkin#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp authored Oct 20, 2023
1 parent fa7ca86 commit e8667b6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions openapi3/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit e8667b6

Please sign in to comment.