Merge pull request #4210 from natasha41575/openapiFromComponent

fix issue with getting openapi schema from components
This commit is contained in:
Kubernetes Prow Robot
2021-10-04 19:27:49 -07:00
committed by GitHub
4 changed files with 189 additions and 1 deletions

View File

@@ -555,6 +555,8 @@ func SetSchema(openAPIField map[string]string, schema []byte, reset bool) error
if schema != nil { // use custom schema
customSchema = schema
kubernetesOpenAPIVersion = "custom"
// if the schema is changed, initSchema should parse the new schema
globalSchema.schemaInit = false
return nil
}
@@ -567,6 +569,8 @@ func SetSchema(openAPIField map[string]string, schema []byte, reset bool) error
return fmt.Errorf("the specified OpenAPI version is not built in")
}
customSchema = nil
// if the schema is changed, initSchema should parse the new schema
globalSchema.schemaInit = false
return nil
}