Commit Graph

1 Commits

Author SHA1 Message Date
lif 9e7ca4d454 Fix Annotated with ForwardRef when using future annotations
When using `from __future__ import annotations` with `Annotated[SomeClass, Depends()]`
where SomeClass is defined after the function, FastAPI was unable to properly
resolve the forward reference and treated the parameter as a query parameter
instead of a dependency.

This fix adds special handling to partially resolve Annotated string annotations,
extracting metadata (like Depends) even when the inner type cannot be fully resolved.

Fixes #13056
2025-12-18 00:27:08 +08:00