Change8

Migrating to FastAPI 0.118.0

Version 0.118.0 introduces 1 breaking change. This guide details how to update your code.

Released: 9/29/2025

1
Breaking Changes
2
Migration Steps
3
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

StreamingResponseUploadFilefastapi.dependencies

Breaking Changes

Issue #1

The execution timing of exit code in dependencies with 'yield' has changed when using StreamingResponse. Exit code now runs after the response is sent rather than before, which may affect resources that expected to be closed prior to transmission.

Migration Steps

  1. 1
    If you rely on database sessions or resources within a 'yield' dependency while using StreamingResponse, ensure your logic accounts for the resource closing after the stream completes.
  2. 2
    Review 'Advanced Dependencies' documentation if you need to manually close sessions before the response is sent.

Release Summary

FastAPI 0.118.0 fixes a critical issue where dependencies with 'yield' (like database sessions) were closed before StreamingResponse could finish, and updates security tutorials to use pwdlib.

Need More Details?

View the full release notes and all changes for FastAPI 0.118.0.

View Full Changelog