Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Allow user to bind query parameters to structs directly #1214

Closed
QuantumGhost opened this issue Oct 26, 2018 · 2 comments · Fixed by #1681
Closed

Proposal: Allow user to bind query parameters to structs directly #1214

QuantumGhost opened this issue Oct 26, 2018 · 2 comments · Fixed by #1681

Comments

@QuantumGhost
Copy link

Issue Description

Currently echo.DefaultBinder#Bind bind parameters to structs based on request method and content length. More specifically, it only retrieves data from Context#QueryParams when req.ContentLength == 0 and req.Method is GET or DELETE. So it's impossible for user to bind query parameters to structs when request method is neither GET nor DELETE.

I hope that echo.DefaultBinder could add a method BindQuery, which binds query parameters to structs directly.

A even better (but incompatible) change is to add BindQuery method to the echo.Binder inferface, and implement this method in echo.DefaultBinder.

@stale
Copy link

stale bot commented Dec 25, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@lammel
Copy link
Contributor

lammel commented Jan 5, 2021

On a side note. This has been resolved, docs are being updated and binding is much more capable now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants