- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
🐛 Fix parameterless Depends()
with generics
#9479
🐛 Fix parameterless Depends()
with generics
#9479
Conversation
Previously, using parameterless `Depends()` in a generic context would bind the dependency to the first encountered concrete type. Fixes fastapi#9450.
📝 Docs preview for commit a8cb514 at: https://64515f2306603a0078b9209c--fastapi.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done, very clean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice thorough tests, well done
Looking forward to this fix. I want to use code from #9450 as example to implement injection of contollers in my project |
Hi @nzig, I've been watching this pr all month. And I'm already beginning to think that if it will be put in, it will not happen very soon. But it's a very cool fix, which will allow to write less monotonous code for your classes. Maybe it's possible to do something to get this pr accepted faster? |
@tiangolo hi, is it possible that this bug fix request will ever be accepted? |
@Kludex @JarroVGIT @jgould22 @ycd Perhaps one of you can somehow contribute to the promotion of this pull request? This request fixes a feature that was added a little less than a year ago, and it would be nice to get full functionality. |
@tiangolo hi! This is a very cool feature that makes the code more readable and clean. Should we hope for its will be accepted? |
Thanks @nzig! 🚀 And thanks everyone for the discussion. ☕ This will be available in the next hours in FastAPI 0.110.1 🎉 |
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Previously, using parameterless
Depends()
in a generic context would bind the dependency to the first encountered concrete type.Fixes #9450.