Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -847,11 +847,17 @@ func (c *Context) ShouldBindHeader(obj any) error {

// ShouldBindUri binds the passed struct pointer using the specified binding engine.
func (c *Context) ShouldBindUri(obj any) error {
return c.ShouldBindUriWith(obj, binding.Uri)
}

// ShouldBindUriWith binds the passed struct pointer using the specified uri
// binding engine. See the binding package.
func (c *Context) ShouldBindUriWith(obj any, b binding.BindingUri) error {
m := make(map[string][]string, len(c.Params))
for _, v := range c.Params {
m[v.Key] = []string{v.Value}
}
return binding.Uri.BindUri(m, obj)
return b.BindUri(m, obj)
}

// ShouldBindWith binds the passed struct pointer using the specified binding engine.
Expand Down