Merge b7132ed5ecb18a82bdba776eacb01dae57b88d2c into 4dec17afdff48e8018c83618fbbe69fceeb2b41d

This commit is contained in:
Petr Vaněk 2025-10-06 19:33:16 -03:00 committed by GitHub
commit c1360f2d53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -855,11 +855,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.