render
render copied to clipboard
Add support for binding query params into a struct?
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
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.