fix(deps): update dependency fastapi to ^0.128.0

This MR contains the following updates:

Package Type Update Change
fastapi (changelog) dependencies minor ^0.112.0 -> ^0.128.0

Release Notes

fastapi/fastapi (fastapi)

v0.128.0

Compare Source

Breaking Changes
Internal

v0.127.1

Compare Source

Refactors
Docs
Translations
Internal

v0.127.0

Compare Source

Breaking Changes
Translations
  • 🔧 Add LLM prompt file for Korean, generated from the existing translations. MR #​14546 by @​tiangolo.
  • 🔧 Add LLM prompt file for Japanese, generated from the existing translations. MR #​14545 by @​tiangolo.
Internal

v0.126.0

Compare Source

Upgrades
  • Drop support for Pydantic v1, keeping short temporary support for Pydantic v2's pydantic.v1. MR #​14575 by @​tiangolo.
    • The minimum version of Pydantic installed is now pydantic >=2.7.0.
    • The standard dependencies now include pydantic-settings >=2.0.0 and pydantic-extra-types >=2.0.0.
Docs
Translations
  • 🔧 Add LLM prompt file for Ukrainian, generated from the existing translations. MR #​14548 by @​tiangolo.
Internal

v0.125.0

Compare Source

Breaking Changes
  • 🔧 Drop support for Python 3.8. MR #​14563 by @​tiangolo.
    • This would actually not be a breaking change as no code would really break. Any Python 3.8 installer would just refuse to install the latest version of FastAPI and would only install 0.124.4. Only marking it as a "breaking change" to make it visible.
Refactors
Docs
Translations
Internal

v0.124.4

Compare Source

Fixes

v0.124.3

Compare Source

Fixes
  • 🐛 Fix support for tagged union with discriminator inside of Annotated with Body(). MR #​14512 by @​tiangolo.
Refactors
Docs
Translations
Internal

v0.124.2

Compare Source

Fixes
  • 🐛 Fix support for if TYPE_CHECKING, non-evaluated stringified annotations. MR #​14485 by @​tiangolo.

v0.124.1

Compare Source

Fixes
  • 🐛 Fix handling arbitrary types when using arbitrary_types_allowed=True. MR #​14482 by @​tiangolo.
Docs
Internal

v0.124.0

Compare Source

Features
Internal

v0.123.10

Compare Source

Fixes

v0.123.9

Compare Source

Fixes
  • 🐛 Fix OAuth2 scopes in OpenAPI in extra corner cases, parent dependency with scopes, sub-dependency security scheme without scopes. MR #​14459 by @​tiangolo.

v0.123.8

Compare Source

Fixes
  • 🐛 Fix OpenAPI security scheme OAuth2 scopes declaration, deduplicate security schemes with different scopes. MR #​14455 by @​tiangolo.

v0.123.7

Compare Source

Fixes

v0.123.6

Compare Source

Fixes
  • 🐛 Fix support for functools wraps and partial combined, for async and regular functions and classes in path operations and dependencies. MR #​14448 by @​tiangolo.

v0.123.5

Compare Source

Features
Fixes
  • 🐛 Fix optional sequence handling with new union syntax from Python 3.10. MR #​14430 by @​Viicos.
Refactors
  • 🔥 Remove dangling extra condiitonal no longer needed. MR #​14435 by @​tiangolo.
  • ♻️ Refactor internals, update is_coroutine check to reuse internal supported variants (unwrap, check class). MR #​14434 by @​tiangolo.
Translations

v0.123.4

Compare Source

Fixes
  • 🐛 Fix OpenAPI schema support for computed fields when using separate_input_output_schemas=False. MR #​13207 by @​vgrafe.
Docs

v0.123.3

Compare Source

Fixes

v0.123.2

Compare Source

Fixes
Docs

v0.123.1

Compare Source

Fixes
Internal

v0.123.0

Compare Source

Fixes
  • 🐛 Cache dependencies that don't use scopes and don't have sub-dependencies with scopes. MR #​14419 by @​tiangolo.

v0.122.1

Compare Source

Fixes
Docs
Internal

v0.122.0

Compare Source

Fixes
Internal

v0.121.3

Compare Source

0.121.3

Refactors
  • ♻️ Make the result of Depends() and Security() hashable, as a workaround for other tools interacting with these internal parts. MR #​14372 by @​tiangolo.
Upgrades
Docs

v0.121.2

Compare Source

Fixes
Docs
Translations

v0.121.1

Compare Source

Fixes
  • 🐛 Fix Depends(func, scope='function') for top level (parameterless) dependencies. MR #​14301 by @​luzzodev.
Docs
  • 📝 Upate docs for advanced dependencies with yield, noting the changes in 0.121.0, adding scope. MR #​14287 by @​tiangolo.
Internal

v0.121.0

Compare Source

Features
Internal

v0.120.4

Compare Source

Fixes

v0.120.3

Compare Source

Refactors
  • ♻️ Reduce internal cyclic recursion in dependencies, from 2 functions calling each other to 1 calling itself. MR #​14256 by @​tiangolo.
  • ♻️ Refactor internals of dependencies, simplify code and remove get_param_sub_dependant. MR #​14255 by @​tiangolo.
  • ♻️ Refactor internals of dependencies, simplify using dataclasses. MR #​14254 by @​tiangolo.
Docs

v0.120.2

Compare Source

Fixes
Internal

v0.120.1

Compare Source

Upgrades
Internal
  • 🔧 Add license and license-files to pyproject.toml, remove License from classifiers. MR #​14230 by @​YuriiMotov.

v0.120.0

Compare Source

There are no major nor breaking changes in this release.

The internal reference documentation now uses annotated_doc.Doc instead of typing_extensions.Doc, this adds a new (very small) dependency on annotated-doc, a package made just to provide that Doc documentation utility class.

I would expect typing_extensions.Doc to be deprecated and then removed at some point from typing_extensions, for that reason there's the new annotated-doc micro-package. If you are curious about this, you can read more in the repo for annotated-doc.

This new version 0.120.0 only contains that transition to the new home package for that utility class Doc.

Translations
Internal

v0.119.1

Compare Source

Fixes
  • 🐛 Fix internal Pydantic v1 compatibility (warnings) for Python 3.14 and Pydantic 2.12.1. MR #​14186 by @​svlandeg.
Docs
  • 📝 Replace starlette.io by starlette.dev and uvicorn.org by uvicorn.dev. MR #​14176 by @​Kludex.
Internal

v0.119.0

Compare Source

FastAPI now (temporarily) supports both Pydantic v2 models and pydantic.v1 models at the same time in the same app, to make it easier for any FastAPI apps still using Pydantic v1 to gradually but quickly migrate to Pydantic v2.

from fastapi import FastAPI
from pydantic import BaseModel as BaseModelV2
from pydantic.v1 import BaseModel

class Item(BaseModel):
    name: str
    description: str | None = None

class ItemV2(BaseModelV2):
    title: str
    summary: str | None = None

app = FastAPI()

@​app.post("/items/", response_model=ItemV2)
def create_item(item: Item):
    return {"title": item.name, "summary": item.description}

Adding this feature was a big effort with the main objective of making it easier for the few applications still stuck in Pydantic v1 to migrate to Pydantic v2.

And with this, support for Pydantic v1 is now deprecated and will be removed from FastAPI in a future version soon.

Note: have in mind that the Pydantic team already stopped supporting Pydantic v1 for recent versions of Python, starting with Python 3.14.

You can read in the docs more about how to Migrate from Pydantic v1 to Pydantic v2.

Features
  • Add support for from pydantic.v1 import BaseModel, mixed Pydantic v1 and v2 models in the same app. MR #​14168 by @​tiangolo.

v0.118.3

Compare Source

Upgrades

v0.118.2

Compare Source

Fixes
Internal

v0.118.1

Compare Source

Upgrades
Docs
Translations
Internal

v0.118.0

Compare Source

0.118.0

Fixes
  • 🐛 Fix support for StreamingResponses with dependencies with yield or UploadFiles, close after the response is done. MR #​14099 by @​tiangolo.

Before FastAPI 0.118.0, if you used a dependency with yield, it would run the exit code after the path operation function returned but right before sending the response.

This change also meant that if you returned a StreamingResponse, the exit code of the dependency with yield would have been already run.

For example, if you had a database session in a dependency with yield, the StreamingResponse would not be able to use that session while streaming data because the session would have already been closed in the exit code after yield.

This behavior was reverted in 0.118.0, to make the exit code after yield be executed after the response is sent.

You can read more about it in the docs for Advanced Dependencies - Dependencies with yield, HTTPException, except and Background Tasks. Including what you could do if you wanted to close a database session earlier, before returning the response to the client.

Docs
Translations
Internal

v0.117.1

Compare Source

Fixes

v0.117.0

Compare Source

Features
Fixes
  • Fix default_factory for response model field with Pydantic V1. MR #​9704 by @​vvanglro.
  • 🐛 Fix inconsistent processing of model docstring formfeed char with Pydantic V1. MR #​6039 by @​MaxwellPayne.
  • 🐛 Fix jsonable_encoder alters json_encoders of Pydantic v1 objects. MR #​4972 by @​aboubacs.
  • 🐛 Reenable allow_arbitrary_types when only 1 argument is used on the API endpoint. MR #​13694 by @​rmawatson.
  • 🐛 Fix inspect.getcoroutinefunction() can break testing with unittest.mock.patch(). MR #​14022 by @​secrett2633.
Refactors
Docs
Translations
Internal

v0.116.2

Compare Source

Upgrades
Docs
Translations
Internal

v0.116.1

Compare Source

Upgrades
Docs
  • 📝 Add notification about impending changes in Translations to docs/en/docs/contributing.md. MR #​13886 by @​YuriiMotov.
Internal

v0.116.0

Compare Source

Features

Installing fastapi[standard] now includes fastapi-cloud-cli.

This will allow you to deploy to FastAPI Cloud with the fastapi deploy command.

If you want to install fastapi with the standard dependencies but without fastapi-cloud-cli, you can install instead fastapi[standard-no-fastapi-cloud-cli].

Translations
Internal

v0.115.14

Compare Source

Fixes
Docs
Translations
Internal

v0.115.13

Compare Source

Fixes
  • 🐛 Fix truncating the model's description with form feed (\f) character for Pydantic V2. MR #​13698 by @​YuriiMotov.
Refactors
Upgrades
Docs
Translations
Internal

v0.115.12

Compare Source

Fixes
Docs
Translations
Internal

v0.115.11

Compare Source

Fixes
Translations
  • 🌐 Add Russian translation for docs/ru/docs/tutorial/middleware.md. MR #​13412 by @​alv2017.
Internal

v0.115.10

Compare Source

Fixes
  • ♻️ Update internal annotation usage for compatibility with Pydantic 2.11. MR #​13314 by @​Viicos.
Upgrades
Translations

v0.115.9

Compare Source

Fixes
  • 🐛 Ensure that HTTPDigest only raises an exception when auto_error is True. MR #​2939 by @​arthurio.
Refactors
Docs
Translations
Internal

v0.115.8

Compare Source

Fixes
  • 🐛 Fix OAuth2PasswordRequestForm and OAuth2PasswordRequestFormStrict fixed grant_type "password" RegEx. MR #​9783 by @​skarfie123.
Refactors
Docs
Translations
  • 🌐 Add Japanese translation for docs/ja/docs/environment-variables.md. MR #​13226 by @​k94-ishi.
  • 🌐 Add Russian translation for docs/ru/docs/advanced/async-tests.md. MR #​13227 by @​Rishat-F.
  • 🌐 Update Russian translation for docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md. MR #​13252 by @​Rishat-F.
  • 🌐 Add Russian translation for docs/ru/docs/tutorial/bigger-applications.md. MR #​13154 by @​alv2017.
Internal

v0.115.7

Compare Source

Upgrades
Refactors
Docs
Translations
Internal

v0.115.6

Compare Source

Fixes
  • 🐛 Preserve traceback when an exception is raised in sync dependency with yield. MR #​5823 by @​sombek.
Refactors
  • ♻️ Update tests and internals for compatibility with Pydantic >=2.10. MR #​12971 by @​tamird.
Docs
Translations
  • 🌐 Add Traditional Chinese translation for docs/zh-hant/docs/async.md. MR #​12990 by @​ILoveSorasakiHina.
  • 🌐 Add Traditional Chinese translation for docs/zh-hant/docs/tutorial/query-param-models.md. MR #​12932 by @​Vincy1230.
  • 🌐 Add Korean translation for docs/ko/docs/advanced/testing-dependencies.md. MR #​12992 by @​Limsunoh.
  • 🌐 Add Korean translation for docs/ko/docs/advanced/websockets.md. MR #​12991 by @​kwang1215.
  • 🌐 Add Portuguese translation for docs/pt/docs/tutorial/response-model.md. MR #​12933 by @​AndreBBM.
  • 🌐 Add Korean translation for docs/ko/docs/advanced/middlewares.md. MR #​12753 by @​nahyunkeem.
  • 🌐 Add Korean translation for docs/ko/docs/advanced/openapi-webhooks.md. MR #​12752 by @​saeye.
  • 🌐 Add Chinese translation for docs/zh/docs/tutorial/query-param-models.md. MR #​12931 by @​Vincy1230.
  • 🌐 Add Russian translation for docs/ru/docs/tutorial/query-param-models.md. MR #​12445 by @​gitgernit.
  • 🌐 Add Korean translation for docs/ko/docs/tutorial/query-param-models.md. MR #​12940 by @​jts8257.
  • 🔥 Remove obsolete tutorial translation to Chinese for docs/zh/docs/tutorial/sql-databases.md, it references files that are no longer on the repo. MR #​12949 by @​tiangolo.
Internal

v0.115.5

Compare Source

Refactors
Docs
Translations
Internal

v0.115.4

Compare Source

Refactors
  • ♻️ Update logic to import and check python-multipart for compatibility with newer version. MR #​12627 by @​tiangolo.
Docs
Translations
Internal

v0.115.3

Compare Source

Upgrades
Docs
Translations
Internal

v0.115.2

Compare Source

Upgrades

v0.115.1

Compare Source

Fixes
Refactors
Docs
Translations
Internal

v0.115.0

Compare Source

Highlights

Now you can declare Query, Header, and Cookie parameters with Pydantic models. 🎉

Query Parameter Models

Use Pydantic models for Query parameters:

from typing import Annotated, Literal

from fastapi import FastAPI, Query
from pydantic import BaseModel, Field

app = FastAPI()

class FilterParams(BaseModel):
    limit: int = Field(100, gt=0, le=100)
    offset: int = Field(0, ge=0)
    order_by: Literal["created_at", "updated_at"] = "created_at"
    tags: list[str] = []

@​app.get("/items/")
async def read_items(filter_query: Annotated[FilterParams, Query()]):
    return filter_query

Read the new docs: Query Parameter Models.

Header Parameter Models

Use Pydantic models for Header parameters:

from typing import Annotated

from fastapi import FastAPI, Header
from pydantic import BaseModel

app = FastAPI()

class CommonHeaders(BaseModel):
    host: str
    save_data: bool
    if_modified_since: str | None = None
    traceparent: str | None = None
    x_tag: list[str] = []

@​app.get("/items/")
async def read_items(headers: Annotated[CommonHeaders, Header()]):
    return headers

Read the new docs: Header Parameter Models.

Use Pydantic models for Cookie parameters:

from typing import Annotated

from fastapi import Cookie, FastAPI
from pydantic import BaseModel

app = FastAPI()

class Cookies(BaseModel):
    session_id: str
    fatebook_tracker: str | None = None
    googall_tracker: str | None = None

@​app.get("/items/")
async def read_items(cookies: Annotated[Cookies, Cookie()]):
    return cookies

Read the new docs: Cookie Parameter Models.

Use Pydantic models to restrict extra values for Query parameters (also applies to Header and Cookie parameters).

To achieve it, use Pydantic's model_config = {"extra": "forbid"}:

from typing import Annotated, Literal

from fastapi import FastAPI, Query
from pydantic import BaseModel, Field

app = FastAPI()

class FilterParams(BaseModel):
    model_config = {"extra": "forbid"}

    limit: int = Field(100, gt=0, le=100)
    offset: int = Field(0, ge=0)
    order_by: Literal["created_at", "updated_at"] = "created_at"
    tags: list[str] = []

@​app.get("/items/")
async def read_items(filter_query: Annotated[FilterParams, Query()]):
    return filter_query

This applies to Query, Header, and Cookie parameters, read the new docs:

Features
  • Add support for Pydantic models for parameters using Query, Cookie, Header. MR #​12199 by @​tiangolo.
Translations
  • 🌐 Add Portuguese translation for docs/pt/docs/advanced/security/http-basic-auth.md. MR #​12195 by @​ceb10n.
Internal

v0.114.2

Compare Source

Fixes
Translations
Internal

v0.114.1

Compare Source

Refactors
  • Improve performance in request body parsing with a cache for internal model fields. MR #​12184 by @​tiangolo.
Docs
  • 📝 Remove duplicate line in docs for docs/en/docs/environment-variables.md. MR #​12169 by @​prometek.
Translations
Internal

v0.114.0

Compare Source

You can restrict form fields to only include those declared in a Pydantic model and forbid any extra field sent in the request using Pydantic's model_config = {"extra": "forbid"}:

from typing import Annotated

from fastapi import FastAPI, Form
from pydantic import BaseModel

app = FastAPI()

class FormData(BaseModel):
    username: str
    password: str
    model_config = {"extra": "forbid"}

@​app.post("/login/")
async def login(data: Annotated[FormData, Form()]):
    return data

Read the new docs: Form Models - Forbid Extra Form Fields.

Features
Docs
Internal
  • Update internal tests for latest Pydantic, including CI tweaks to install the latest Pydantic. MR #​12147 by @​tiangolo.

v0.113.0

Compare Source

Now you can declare form fields with Pydantic models:

from typing import Annotated

from fastapi import FastAPI, Form
from pydantic import BaseModel

app = FastAPI()

class FormData(BaseModel):
    username: str
    password: str

@​app.post("/login/")
async def login(data: Annotated[FormData, Form()]):
    return data

Read the new docs: Form Models.

Features
Internal

v0.112.4

Compare Source

This release is mainly a big internal refactor to enable adding support for Pydantic models for Form fields, but that feature comes in the next release.

This release shouldn't affect apps using FastAPI in any way. You don't even have to upgrade to this version yet. It's just a checkpoint. 🤓

Refactors
  • ♻️ Refactor deciding if embed body fields, do not overwrite fields, compute once per router, refactor internals in preparation for Pydantic models in Form, Query and others. MR #​12117 by @​tiangolo.
Internal
  • ⏪️ Temporarily revert " Add support for Pydantic models in Form parameters" to make a checkpoint release. MR #​12128 by @​tiangolo.
  • Add support for Pydantic models in Form parameters. MR #​12127 by @​tiangolo. Reverted to make a checkpoint release with only refactors.

v0.112.3

Compare Source

This release is mainly internal refactors, it shouldn't affect apps using FastAPI in any way. You don't even have to upgrade to this version yet. There are a few bigger releases coming right after. 🚀

Refactors
  • ♻️ Refactor internal check_file_field(), rename to ensure_multipart_is_installed() to clarify its purpose. MR #​12106 by @​tiangolo.
  • ♻️ Rename internal create_response_field() to create_model_field() as it's used for more than response models. MR #​12103 by @​tiangolo.
  • ♻️ Refactor and simplify internal data from solve_dependencies() using dataclasses. MR #​12100 by @​tiangolo.
  • ♻️ Refactor and simplify internal analyze_param() to structure data with dataclasses instead of tuple. MR #​12099 by @​tiangolo.
  • ♻️ Refactor and simplify dependencies data structures with dataclasses. MR #​12098 by @​tiangolo.
Docs
Translations
Internal

v0.112.2

Compare Source

Fixes
Refactors
Docs
Translations
Internal

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻️ Rebasing: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this MR and you won't be reminded about this update again.


  • If you want to rebase/retry this MR, check this box

This MR has been generated by Renovate Bot.

Edited by renovate

Merge request reports

Loading