setters 2.0

This commit is contained in:
Phillip Wittrock
2020-02-10 12:32:07 -08:00
parent ebcc49d064
commit 7097013426
9 changed files with 981 additions and 4 deletions

View File

@@ -49,6 +49,11 @@ func AddSchema(s []byte) (*spec.Schema, error) {
return parse(s)
}
// ResetOpenAPI resets the openapi data to empty
func ResetOpenAPI() {
globalSchema = openapiData{}
}
// AddDefinitions adds the definitions to the global schema.
func AddDefinitions(definitions spec.Definitions) {
// initialize values if they have not yet been set
@@ -123,7 +128,7 @@ func GetSchema(s string) (*ResourceSchema, error) {
// schema as part of the global schema.
// Must be called before the schema is used.
func SuppressBuiltInSchemaUse() {
globalSchema.noUseBuiltInSchema = false
globalSchema.noUseBuiltInSchema = true
}
// Elements returns the Schema for the elements of an array.