You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the classes as dependencies docs page https://fastapi.tiangolo.com/tutorial/dependencies/classes-as-dependencies/ is incredibly unclear and confusing. It fails to explain that actual point of class based dependency injection. And does not show examples of this pattern actually being used with annotated in the constructors etc.
As shown in the example code the DI system is incredibly powerful and lets you write significantly more scalable code easily. I think the docs could be updated to more accurately advertise this incredible feature.
Operating System
Linux, Windows, macOS, Other
Operating System Details
No response
FastAPI Version
Latest
Python Version
3.10
Additional Context
I would be willing to take on the requirement of updating this docs page should it be deemed a good contribution.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
I believe the classes as dependencies docs page https://fastapi.tiangolo.com/tutorial/dependencies/classes-as-dependencies/ is incredibly unclear and confusing. It fails to explain that actual point of class based dependency injection. And does not show examples of this pattern actually being used with annotated in the constructors etc.
As shown in the example code the DI system is incredibly powerful and lets you write significantly more scalable code easily. I think the docs could be updated to more accurately advertise this incredible feature.
Operating System
Linux, Windows, macOS, Other
Operating System Details
No response
FastAPI Version
Latest
Python Version
3.10
Additional Context
I would be willing to take on the requirement of updating this docs page should it be deemed a good contribution.
Beta Was this translation helpful? Give feedback.
All reactions