fix(uri): query binding bug (#3236)

* fix query mapping

* query binding test
This commit is contained in:
illiafox
2024-03-21 16:28:42 +02:00
committed by GitHub
parent 78f4687875
commit 8790d08909
2 changed files with 25 additions and 2 deletions
+2 -2
View File
@@ -12,9 +12,9 @@ func (queryBinding) Name() string {
return "query"
}
func (queryBinding) Bind(req *http.Request, obj any) error {
func (q queryBinding) Bind(req *http.Request, obj any) error {
values := req.URL.Query()
if err := mapForm(obj, values); err != nil {
if err := mapFormByTag(obj, values, q.Name()); err != nil {
return err
}
return validate(obj)