Skip to main content

FastAPI 0.140.7

Release Date: July 27, 2026

FastAPI 0.140.7 has been released as a maintenance patch following the 0.140.0 major, bringing a notable refactor to how OpenAPI dependencies are handled under the hood.

What Changed

The headline change in this release is a refactor to avoid flattening dependencies for OpenAPI. Previously, FastAPI's OpenAPI generation would flatten dependency trees when producing the schema, which could lead to overly verbose or redundant entries in the generated OpenAPI spec. This release optimises that process, resulting in cleaner and more maintainable API documentation output.

Why It Matters

For teams that generate client SDKs or API documentation directly from their OpenAPI spec, cleaner dependency resolution means less noise in generated code and fewer false positives in schema validation tools. The change is entirely internal — no API surface changes or breaking modifications required.

Internal Improvements

  • Upgraded latest-changes — the CI tooling for generating changelogs has been bumped to 0.7.1, ensuring future release notes are even more accurate
  • OpenAPI dependency benchmarks — new CI benchmarks have been added to track OpenAPI generation performance over time, preventing regressions

Upgrade Notes

This is a drop-in replacement for 0.140.x users. There are no breaking changes, no deprecations, and no configuration changes. Run pip install --upgrade fastapi to get the latest.

FastAPI 0.140.7 is available now on PyPI. Visit the official docs for the full changelog and migration guides.

What is New?

By continuing to use the site, you agree to the use of cookies.