@@ -78,10 +78,10 @@ var formTypeTruthTable = map[string]map[bool][]ParameterFormType{
7878// | `list(string)` | Y | | `radio` | |
7979// | `list(string)` | N | | `tag-select` | |
8080// | `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 ) {
8282 allowed , ok := formTypeTruthTable [paramType ][optionCount > 0 ]
8383 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 )
8585 }
8686
8787 if specifiedFormType == ParameterFormTypeDefault {
@@ -90,15 +90,15 @@ func ValidateFormType(paramType string, optionCount int, specifiedFormType Param
9090 }
9191
9292 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 )
9494 }
9595
9696 // Special case
9797 if paramType == "list(string)" && specifiedFormType == ParameterFormTypeMultiSelect {
98- return ParameterFormTypeMultiSelect , "string" , nil
98+ return "string" , ParameterFormTypeMultiSelect , nil
9999 }
100100
101- return specifiedFormType , paramType , nil
101+ return paramType , specifiedFormType , nil
102102}
103103
104104func toStrings [A ~ string ](l []A ) []string {
0 commit comments