added missing array value normalization

This commit is contained in:
Gani Georgiev 2023-06-26 12:47:56 +03:00
parent e6cf4ad2ef
commit 68157a3a65
2 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ func bindFormData(c echo.Context, i interface{}) error {
} else { } else {
normalized := make([]any, total) normalized := make([]any, total)
for i, vItem := range v { for i, vItem := range v {
normalized[i] = vItem normalized[i] = normalizeMultipartValue(vItem)
} }
rv.SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(normalized)) rv.SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(normalized))
} }

View File

@ -50,7 +50,7 @@ func TestBindBody(t *testing.T) {
}.Encode(), }.Encode(),
), ),
echo.MIMEApplicationForm, echo.MIMEApplicationForm,
`{"bool":true,"bools":["true","false"],"number":-123,"numbers":["123","456"],"stings":["str1","str2"],"string":"str"}`, `{"bool":true,"bools":[true,false],"number":-123,"numbers":[123,456],"stings":["str1","str2"],"string":"str"}`,
false, false,
}, },
} }