@@ -78,10 +78,10 @@ var formTypeTruthTable = map[string]map[bool][]ParameterFormType{
78
78
// | `list(string)` | Y | | `radio` | |
79
79
// | `list(string)` | N | | `tag-select` | |
80
80
// | `list(string)` | Y | `multi-select` | `multi-select` | Option values will be `string` |
81
- func ValidateFormType (paramType string , optionCount int , specifiedFormType ParameterFormType ) (ParameterFormType , string , error ) {
81
+ func ValidateFormType (paramType string , optionCount int , specifiedFormType ParameterFormType ) (string , ParameterFormType , error ) {
82
82
allowed , ok := formTypeTruthTable [paramType ][optionCount > 0 ]
83
83
if ! ok || len (allowed ) == 0 {
84
- return specifiedFormType , paramType , xerrors .Errorf ("value type %q is not supported for 'form_types'" , paramType )
84
+ return paramType , specifiedFormType , xerrors .Errorf ("value type %q is not supported for 'form_types'" , paramType )
85
85
}
86
86
87
87
if specifiedFormType == ParameterFormTypeDefault {
@@ -90,15 +90,15 @@ func ValidateFormType(paramType string, optionCount int, specifiedFormType Param
90
90
}
91
91
92
92
if ! slices .Contains (allowed , specifiedFormType ) {
93
- return specifiedFormType , paramType , xerrors .Errorf ("value type %q is not supported for 'form_types'" , paramType )
93
+ return paramType , specifiedFormType , xerrors .Errorf ("value type %q is not supported for 'form_types'" , paramType )
94
94
}
95
95
96
96
// Special case
97
97
if paramType == "list(string)" && specifiedFormType == ParameterFormTypeMultiSelect {
98
- return ParameterFormTypeMultiSelect , "string" , nil
98
+ return "string" , ParameterFormTypeMultiSelect , nil
99
99
}
100
100
101
- return specifiedFormType , paramType , nil
101
+ return paramType , specifiedFormType , nil
102
102
}
103
103
104
104
func toStrings [A ~ string ](l []A ) []string {
0 commit comments