Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reproduce issue
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
fenollp committed Mar 2, 2021
1 parent 4c01aae commit 6c31b3f
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
@@ -161,6 +161,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(),

0 comments on commit 6c31b3f

Please sign in to comment.