Features
- Add support for injecting
HTTPConnection
(asRequest
andWebSocket
). Useful for sharing app state in dependencies. PR #1827 by @nsidnev. - Export
WebSocketDisconnect
and add example handling WebSocket disconnections to docs. PR #1822 by @rkbeatss.
Breaking Changes
- Require Pydantic >
1.0.0
.- Remove support for deprecated Pydantic
0.32.2
. This improves maintainability and allows new features. - In
FastAPI
andAPIRouter
:- Remove path operation decorators related/deprecated parameter
response_model_skip_defaults
(useresponse_model_exclude_unset
instead). - Change path operation decorators parameter default for
response_model_exclude
fromset()
toNone
(as is in Pydantic).
- Remove path operation decorators related/deprecated parameter
- In
encoders.jsonable_encoder
:- Remove deprecated
skip_defaults
, use insteadexclude_unset
. - Set default of
exclude
fromset()
toNone
(as is in Pydantic).
- Remove deprecated
- PR #1862.
- Remove support for deprecated Pydantic
- In
encoders.jsonable_encoder
remove parametersqlalchemy_safe
.- It was an early hack to allow returning SQLAlchemy models, but it was never documented, and the recommended way is using Pydantic's
orm_mode
as described in the tutorial: SQL (Relational) Databases. - PR #1864.
- It was an early hack to allow returning SQLAlchemy models, but it was never documented, and the recommended way is using Pydantic's
Docs
- Add link to the course by TestDriven.io: Test-Driven Development with FastAPI and Docker. PR #1860.
- Fix empty log message in docs example about handling errors. PR #1815 by @manlix.
- Reword text to reduce ambiguity while not being gender-specific. PR #1824 by @Mause.
Internal
- Add Flake8 linting. Original PR #1774 by @MashhadiNima.
- Disable Gitter bot, as it's currently broken, and Gitter's response doesn't show the problem. PR #1853.