Migrating to FastAPI 0.122.0
Version 0.122.0 introduces 1 breaking change. This guide details how to update your code.
Released: 11/24/2025
1
Breaking Changes
2
Migration Steps
7
Affected Symbols
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
fastapi.security.HTTPBasicfastapi.security.HTTPBearerfastapi.security.OAuth2fastapi.security.OpenIdConnectfastapi.security.APIKeyCookiefastapi.security.APIKeyHeaderfastapi.security.APIKeyQueryBreaking Changes
●Issue #1
Security classes now return a 401 status code instead of 403 when credentials are missing. If your client code or tests depend on 403, you must override the security classes to restore the old behavior.
Migration Steps
- 1Review client-side error handling for authentication; update expected status codes from 403 to 401.
- 2If the old 403 behavior is required, follow the guide to override security classes: https://fastapi.tiangolo.com/how-to/authentication-error-status-code/
Release Summary
This release updates security classes to return a more accurate 401 Unauthorized status code instead of 403 Forbidden when credentials are missing, and includes several internal CI/documentation improvements.
Need More Details?
View the full release notes and all changes for FastAPI 0.122.0.
View Full Changelog