Skip to content

Commit

Permalink
fix query mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
illiafox committed Jul 10, 2022
1 parent b57163a commit c17e9f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions binding/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ func (queryBinding) Name() string {
return "query"
}

func (queryBinding) Bind(req *http.Request, obj any) error {
// TODO: Add tests
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)
Expand Down

0 comments on commit c17e9f1

Please sign in to comment.