The Depends function returns a params.Depends instance, so we need to
check isinstance against params.Depends, not the Depends function itself.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>
- Remove unused type: ignore comments that caused mypy lint failure
- Only apply the partial Annotated resolution for Depends metadata
- For other metadata types (File, Form, Query, etc.), return None to
preserve the original type detection logic
- This fixes the test failures where File/UploadFile params were being
incorrectly identified as query parameters
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
Sync with #14505 (plus some more)
I actually searched for those patterns in VS Code.
Always:
files to exclude: README.md, SECURITY.md, llm-prompt.md
This search & replace cleans up the hash parts everywhere under docs/.
It only finds the four occurences in the two _llm-test.md under docs/de/ and docs/pt/
files to include: docs/**
Search regex: \{[^\S\n]*#([^\S\n]*[a-z0-9]+(?:-[a-z0-9]+)*)[^\S\n]*\}
Replace with: { #$1 }
This search finds headings without hash parts. It finds two headings in docs\de\docs\index.md (those which #14505 fixes) and all headings in docs\pt\docs\tutorial\security\index.md, which I also fixed on the way as that document seems to be in sync. docs\pt\docs\index.md is not in Sync, so I didnt touch it.
files to include: docs/de/**, docs/pt/**
Search regex: ^(#+)[^\S\n]*([^{}#\s]+(?:[^\S\n]+[^{}\s]+)*)[^\S\n]*(?=\n)
(added the missing hash parts)