Commit Graph

4 Commits

Author SHA1 Message Date
pre-commit-ci-lite[bot] dc6c5b8917
🎨 Auto format 2025-12-18 13:22:49 +00:00
lif c171f468d8 Fix CI failures: Python 3.8 compatibility and Pydantic v1 tests
- Fix Python 3.8 compatibility by importing Annotated from typing_extensions
  when running on Python < 3.9
- Simplify get_typed_signature to not use get_type_hints which was causing
  issues with Pydantic v1 parameter detection (Header, Cookie, Query, etc.)
- Instead, expand globalns with module namespace to help resolve forward
  references while keeping the original annotation resolution logic intact

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 21:21:13 +08:00
pre-commit-ci-lite[bot] a975a1704e
🎨 Auto format 2025-12-17 16:28:11 +00:00
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