Commit effcdda0 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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
parents 32580b89 4a7e1df8
...@@ -579,7 +579,7 @@ func (g openAPITypeWriter) generateMapProperty(t *types.Type) error { ...@@ -579,7 +579,7 @@ func (g openAPITypeWriter) generateMapProperty(t *types.Type) error {
case types.Builtin: case types.Builtin:
return fmt.Errorf("please add type %v to getOpenAPITypeFormat function.", elemType) return fmt.Errorf("please add type %v to getOpenAPITypeFormat function.", elemType)
case types.Struct: case types.Struct:
g.generateReferenceProperty(t.Elem) g.generateReferenceProperty(elemType)
case types.Slice, types.Array: case types.Slice, types.Array:
g.generateSliceProperty(elemType) g.generateSliceProperty(elemType)
default: default:
...@@ -603,7 +603,7 @@ func (g openAPITypeWriter) generateSliceProperty(t *types.Type) error { ...@@ -603,7 +603,7 @@ func (g openAPITypeWriter) generateSliceProperty(t *types.Type) error {
case types.Builtin: case types.Builtin:
return fmt.Errorf("please add type %v to getOpenAPITypeFormat function.", elemType) return fmt.Errorf("please add type %v to getOpenAPITypeFormat function.", elemType)
case types.Struct: case types.Struct:
g.generateReferenceProperty(t.Elem) g.generateReferenceProperty(elemType)
default: default:
return fmt.Errorf("slice Element kind %v is not supported in %v", elemType.Kind, t) return fmt.Errorf("slice Element kind %v is not supported in %v", elemType.Kind, t)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment