-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Strongly typed params - deserialization #356
Comments
Can I take this from here? |
Hey I'm agnik, i have some experience in Go, I would love to take on this issue. |
Hi @bruhhgnik, you can take this issue! |
Hey @EwenQuim Thanks for assigning me the issue, hoping on to it real quick |
Hi @bruhhgnik , any news on this? |
Hey, im almost done, i can make the PR by tomorrow EOD |
It's not an easy one, don't hesitate to show us a draft early because there might be many coms incoming ;) |
Sure! on it |
Is your feature request related to a problem? Please describe.
When refactoring an old app, I found that using loosely coupled syntax defined in #174 make it easy to use a parameter in the controller and forget to declare it in the route registration.
Current situation
I still think that variadic route options are good:
I'm just suggesting a new way to declare & deserialize params.
Describe the solution you'd like
Create a type
netHttpContextWithParams[T any]
that embedsnetHttpContext
with a single additional methodParams() T
.Params() T
deserialize the HTTP request's Headers, Query parameters and Cookie in a statically typed struct likeDraft
Later, users will be able to use this syntax:
But for the moment, we just want the new method. We'll plug it in another issue.
Please use spec defined in #119
The text was updated successfully, but these errors were encountered: