From fefb1bc3657b3159095bb6f5124baccb5574c58f Mon Sep 17 00:00:00 2001 From: Mitchellw1233 Date: Fri, 31 Oct 2025 16:27:51 +0100 Subject: [PATCH] add include_extras in type hint to support annotated types --- fastapi_utils/cbv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi_utils/cbv.py b/fastapi_utils/cbv.py index 231325c5..85703fc7 100644 --- a/fastapi_utils/cbv.py +++ b/fastapi_utils/cbv.py @@ -74,7 +74,7 @@ def _init_cbv(cls: Type[Any], instance: Any = None) -> None: ] dependency_names: List[str] = [] - for name, hint in get_type_hints(cls).items(): + for name, hint in get_type_hints(cls, include_extras=True).items(): if is_classvar(hint): continue parameter_kwargs = {"default": getattr(cls, name, Ellipsis)}