feat: support list(string) as coder_parameter (#6618)

* feat: support list(string) as coder_parameter

* Fix
This commit is contained in:
Marcin Tojek
2023-03-16 11:07:10 +01:00
committed by GitHub
parent 7076dee522
commit a7c734c60b
9 changed files with 38 additions and 45 deletions

View File

@ -113,5 +113,6 @@ func validationEnabled(param TemplateVersionParameter) bool {
return len(param.ValidationRegex) > 0 ||
(param.ValidationMin != 0 && param.ValidationMax != 0) ||
len(param.ValidationMonotonic) > 0 ||
param.Type == "bool" // boolean type doesn't have any custom validation rules, but the value must be checked (true/false).
param.Type == "bool" || // boolean type doesn't have any custom validation rules, but the value must be checked (true/false).
param.Type == "list(string)" // list(string) type doesn't have special validation, but we need to check if this is a correct list.
}

View File

@ -43,7 +43,7 @@ type TemplateVersionParameter struct {
Name string `json:"name"`
Description string `json:"description"`
DescriptionPlaintext string `json:"description_plaintext"`
Type string `json:"type" enums:"string,number,bool"`
Type string `json:"type" enums:"string,number,bool,list(string)"`
Mutable bool `json:"mutable"`
DefaultValue string `json:"default_value"`
Icon string `json:"icon"`