Commit Graph

2 Commits

Author SHA1 Message Date
Sharon Yogev fdf66c825e
🐛 Fix using `Annotated` in routers or path operations decorated multiple times (#9315)
* Fix: copy FieldInfo from Annotated arguments

We need to copy the field_info to prevent ourselves from
mutating it.  This allows multiple path or nested routers ,etc.

* 📝 Add comment in fastapi/dependencies/utils.py

Co-authored-by: Nadav Zingerman <7372858+nzig@users.noreply.github.com>

*  Extend and tweak tests for Annotated

*  Tweak coverage, it's probably covered by a different version of Python

---------

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: Nadav Zingerman <7372858+nzig@users.noreply.github.com>
2023-04-13 10:49:22 -07:00
Nadav Zingerman 375513f114
Add support for PEP-593 `Annotated` for specifying dependencies and parameters (#4871)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-03-17 21:35:45 +01:00