-
-
Notifications
You must be signed in to change notification settings - Fork 343
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
Enhancement: Allow body parameter to have an arbitrary name. #3053
Comments
I've guessing this should also apply to other reserved parameters such as |
Yeah. I think we should do this for all injected things. E.g. async def handler(
param: Query[str],
request_body: Body[list[str]],
header: Header[int],
):
... IMO this belongs to the DI redesign and is something I'd definitely want to address as part of that. |
Agree - it would be great to be more flexible in this respect! |
Just want to highlight how nice it would be to split Also discussed in #3223 (comment) & #3223 (comment). FYI. |
@tuukkamustonen That's already in the current proposal, see #3053 (comment) |
Yeah, just wanted to highlight how nice it would be to have those types. The topic of the ticket is "allow ... parameter to have an arbitrary name" (and not add But yeah, good that you have it scoped like that 👍🏻 |
Summary
When you write a handler it is more convenient to have a body parameter named as entity you work with.
Basic Example
Before you required to write live:
After, you CAN to annotate it with
Body
and have an arbitrary name.Drawbacks and Impact
dependency
name and break dependencies resolution.Unresolved questions
No response
Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
The text was updated successfully, but these errors were encountered: