FastAPI 0.145.0 Drops Deprecated openapi_prefix in Breaking Change

FastAPI·18 Oct 2026·2 min read

#fastapi

FastAPI has published release 0.145.0, a small but notable update that finally removes a deprecated API surface. The headline item is a breaking change: the openapi_prefix parameter is gone from the FastAPI class, along with an unused **extra keyword argument. Both changes were authored by @tiangolo in PR #16518. The release also includes a documentation update covering URL paths in templates (PR #16517), which clarifies how mounted applications and prefixes are reflected in rendered template URLs.

Concrete changes in this release:

  • Breaking: removed the deprecated openapi_prefix parameter from the FastAPI application class.
  • Breaking: removed the unused **extra keyword from the same constructor path.
  • Docs: documented URL paths in templates, explaining how request URL paths can be handled inside template rendering.
  • Both code changes landed via PR #16518; the docs update via PR #16517, both by @tiangolo.

Developers still passing openapi_prefix when constructing their application, or relying on arbitrary extra keywords being silently accepted, will see errors after upgrading. The openapi_prefix argument had been deprecated in favour of root_path, so most projects should already be using root_path instead. If your code or any third-party wrapper still references openapi_prefix, audit your app factory and startup code before bumping the version, and switch remaining usages to root_path. Because the removal is explicitly labelled a breaking change, pinning to a specific minor version and reviewing the changelog before upgrading is sensible for production deployments. For teams that already migrated to root_path, this release should be a straightforward, low-risk upgrade that cleans up stale constructor arguments and adds clearer template documentation.

Source: https://github.com/fastapi/fastapi/releases/tag/0.145.0

Related

auto-curated · source linked above← all news