github fastapi/fastapi 0.61.0

latest releases: 0.115.4, 0.115.3, 0.115.2...
4 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.

Don't miss a new fastapi release

NewReleases is sending notifications on new releases.