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

Feature Request: Bind request's body multiple times #2641

Open
samanebi opened this issue Jun 6, 2024 · 0 comments
Open

Feature Request: Bind request's body multiple times #2641

samanebi opened this issue Jun 6, 2024 · 0 comments

Comments

@samanebi
Copy link

samanebi commented Jun 6, 2024

I was struggling with Echo lately to be able to Bind a single request's body multiple times. But because of JSON decode this is not possible. I managed to solve my problem with writing a new Binder that is 90% equal to the DefaultBinder. I was wondering can we actually incorporate such feature inside Echo to avoid writing very similar code to address this matter?

To address this I was thinking about having an BindConfig struct inside DefaultBinder that has a boolean flag to enable or disable shadow read. So by enabling that we cache the decoded body inside context as a map and do the binding on that if it is present. This can not affect DefaultBinder's Bind function very much and the code change on it would be not much. But many guys like me would not be forced to write new Binder very similar to DefaultBinder.

I wanted to report this to see if this is possible or not. If it is possible i would be happy to contribute

@samanebi samanebi changed the title Feature Request: Shadow read Feature Request: Bind request's body multiple times Jun 6, 2024
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

No branches or pull requests

1 participant