This repository demonstrates a bug in FastAPI where form field metadata (like description) is lost when using Depends.
When using Form() inside a dependency function with Depends, the metadata provided (e.g., description) does not appear in the OpenAPI schema.
form_dependency_test.py: Demonstrates the issue usingDependsform_metadata_repro.py: Shows correct behavior when not usingDepends
- Install dependencies:
pip install fastapi uvicorn