mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-19 04:26:39 +00:00
Fix: fixed required items for a Terraform ComponentDefinition (#3257)
If a Terraform variable is required, the item in OpenAPI schema is required. Signed-off-by: Zheng Xi Zhou <zzxwill@gmail.com>
This commit is contained in:
@@ -194,7 +194,9 @@ func GetOpenAPISchemaFromTerraformComponentDefinition(configuration string) ([]b
|
||||
}
|
||||
}
|
||||
schema.Title = k
|
||||
required = append(required, k)
|
||||
if v.Required {
|
||||
required = append(required, k)
|
||||
}
|
||||
if v.Default != nil {
|
||||
schema.Default = v.Default
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ variable "mapVar" {
|
||||
type = "map"
|
||||
}`,
|
||||
want: want{
|
||||
subStr: "account_name",
|
||||
subStr: `"required":["intVar","boolVar","listVar","mapVar"]`,
|
||||
err: nil,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user