render icon indicating copy to clipboard operation
render copied to clipboard

Add support for binding query params into a struct?

Open adelowo opened this issue 3 years ago • 1 comments

type req struct {
    PerPage string `query:"per_page"`
    APIKey string `query:"key"`
}

// an alternative to render.Bind to check query params and convert into req

adelowo avatar Jul 06 '21 16:07 adelowo

I know this feature request is a bit old but this would still be useful to have.

I think implementing this would be pretty straightforward, but if I'm not mistaken we would need to handle the conversion from the query param string to the original field type, which can be a bit cumbersome. A good reference for handling the type conversions could be gorilla/schema.

I would be down to do a pr if the leads have any interest in this.

ricci2511 avatar Jun 25 '23 18:06 ricci2511