Skip to content

Commit

Permalink
reproduce issue
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
  • Loading branch information
fenollp committed Sep 6, 2020
1 parent 5f67f43 commit d0b707c
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions openapi3/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,43 @@ var schemaExamples = []schemaExample{
},
},

{
Title: "NULLABLE ALLOF",
Schema: &Schema{
Type: "object",
Properties: map[string]*SchemaRef{
"value": NewAllOfSchema(
NewBoolSchema().WithNullable(),
NewBoolSchema().WithNullable(),
).NewRef()}},
Serialization: map[string]interface{}{
"type": "object",
"properties": map[string]interface{}{
"value": map[string]interface{}{
"allOf": []interface{}{
map[string]interface{}{
"nullable": true,
"type": "boolean",
},
map[string]interface{}{
"nullable": true,
"type": "boolean",
},
}}}},
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 d0b707c

Please sign in to comment.