fastapi v0.61.0 Release Notes

Release Date: 2020-08-09 // over 3 years ago
  • ๐Ÿ”‹ Features

    • โž• Add support for injecting HTTPConnection (as Request and WebSocket). 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 and APIRouter:
      • Remove path operation decorators related/deprecated parameter response_model_skip_defaults (use response_model_exclude_unset instead).
      • Change path operation decorators parameter default for response_model_exclude from set() to None (as is in Pydantic).
      • In encoders.jsonable_encoder:
      • Remove deprecated skip_defaults, use instead exclude_unset.
      • Set default of exclude from set() to None (as is in Pydantic).
      • PR #1862.
    • ๐Ÿšš In encoders.jsonable_encoder remove parameter sqlalchemy_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.

    ๐Ÿ“„ Docs

    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.