Merge pull request #49055 from mbohlool/bugfix2

Automatic merge from submit-queue (batch tested with PRs 49055, 49128, 49132, 49134, 49110)

OpenAPI bug: Array/Map Ptr Elements' handing was incorrect

If you have an array of map of pointers, OpenAPI spec generation would fail.

fixes: #49074
This commit is contained in:
Kubernetes Submit Queue 2017-07-18 21:54:18 -07:00 committed by GitHub
commit effcdda0ce

View File

@ -579,7 +579,7 @@ func (g openAPITypeWriter) generateMapProperty(t *types.Type) error {
case types.Builtin:
return fmt.Errorf("please add type %v to getOpenAPITypeFormat function.", elemType)
case types.Struct:
g.generateReferenceProperty(t.Elem)
g.generateReferenceProperty(elemType)
case types.Slice, types.Array:
g.generateSliceProperty(elemType)
default:
@ -603,7 +603,7 @@ func (g openAPITypeWriter) generateSliceProperty(t *types.Type) error {
case types.Builtin:
return fmt.Errorf("please add type %v to getOpenAPITypeFormat function.", elemType)
case types.Struct:
g.generateReferenceProperty(t.Elem)
g.generateReferenceProperty(elemType)
default:
return fmt.Errorf("slice Element kind %v is not supported in %v", elemType.Kind, t)
}