apiextension: fix structural additionalProperties in ToOpenAPI()

This commit is contained in:
Dr. Stefan Schimanski 2019-08-23 18:47:09 +02:00
parent a1f1f0b599
commit b91640816d
2 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ func newGenerics(s *apiextensions.JSONSchemaProps) (*Generic, error) {
if err != nil {
return nil, err
}
g.AdditionalProperties = &StructuralOrBool{Structural: ss}
g.AdditionalProperties = &StructuralOrBool{Structural: ss, Bool: true}
} else {
g.AdditionalProperties = &StructuralOrBool{Bool: s.AdditionalProperties.Allows}
}

View File

@ -492,7 +492,7 @@ func Test_ConvertJSONSchemaPropsToOpenAPIv2SchemaByType(t *testing.T) {
expected: &spec.Schema{
SchemaProps: spec.SchemaProps{
AdditionalProperties: &spec.SchemaOrBool{
Allows: false,
Allows: true,
Schema: spec.BooleanProperty(),
},
},