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
{{ message }}
This repository was archived by the owner on Nov 10, 2024. It is now read-only.
The new way to declare a dependency in FastAPI 0.95 is to use arg: Annotated[type, Depends(func)] = default. Using this on a cbv decorated class attribute does not behave as expected. The cbv seems to treat the attribute as if it wasn't annotated at all.
Example:
defmy_dependency():
return"Dependency"@cbv(router)classMyView:
dep: Annotated[str, Depends(my_dependency)
# behaves as ifdep: str