Commit 23b66689 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #44368 from mbohlool/bugfix

Automatic merge from submit-queue Bugfix: OpenAPI generator should pass generate type extensions OpenAPI spec generator does not pass generated type extensions (using `x-kubernetes-` tags on types). This is already working for field extensions but not for types.
parents e60cc6ee ab5bcf6d
...@@ -3,3 +3,5 @@ reviewers: ...@@ -3,3 +3,5 @@ reviewers:
- gmarek - gmarek
- mbohlool - mbohlool
- philips - philips
approvers:
- mbohlool
...@@ -127,6 +127,7 @@ func (o *openAPI) buildDefinitionRecursively(name string) error { ...@@ -127,6 +127,7 @@ func (o *openAPI) buildDefinitionRecursively(name string) error {
} }
if item, ok := o.definitions[name]; ok { if item, ok := o.definitions[name]; ok {
schema := spec.Schema{ schema := spec.Schema{
VendorExtensible: item.Schema.VendorExtensible,
SchemaProps: item.Schema.SchemaProps, SchemaProps: item.Schema.SchemaProps,
SwaggerSchemaProps: item.Schema.SwaggerSchemaProps, SwaggerSchemaProps: item.Schema.SwaggerSchemaProps,
} }
......
...@@ -97,6 +97,7 @@ func (_ TestInput) OpenAPIDefinition() *openapi.OpenAPIDefinition { ...@@ -97,6 +97,7 @@ func (_ TestInput) OpenAPIDefinition() *openapi.OpenAPIDefinition {
}, },
}, },
} }
schema.Extensions = spec.Extensions{"x-test": "test"}
return &openapi.OpenAPIDefinition{ return &openapi.OpenAPIDefinition{
Schema: schema, Schema: schema,
Dependencies: []string{}, Dependencies: []string{},
...@@ -385,6 +386,11 @@ func getTestInputDefinition() spec.Schema { ...@@ -385,6 +386,11 @@ func getTestInputDefinition() spec.Schema {
}, },
}, },
}, },
VendorExtensible: spec.VendorExtensible{
Extensions: spec.Extensions{
"x-test": "test",
},
},
} }
} }
......
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