Fastapi

Latest version: v0.115.12

Safety actively analyzes 723166 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 35

0.115.1

Fixes

* 🐛 Fix openapi generation with responses kwarg. PR [10895](https://github.com/fastapi/fastapi/pull/10895) by [flxdot](https://github.com/flxdot).
* 🐛 Remove `Required` shadowing from fastapi using Pydantic v2. PR [12197](https://github.com/fastapi/fastapi/pull/12197) by [pachewise](https://github.com/pachewise).

Refactors

* ♻️ Update type annotations for improved `python-multipart`. PR [12407](https://github.com/fastapi/fastapi/pull/12407) by [tiangolo](https://github.com/tiangolo).

Docs

* ✨ Add new tutorial for SQL databases with SQLModel. PR [12285](https://github.com/fastapi/fastapi/pull/12285) by [tiangolo](https://github.com/tiangolo).
* 📝 Add External Link: How to profile a FastAPI asynchronous request. PR [12389](https://github.com/fastapi/fastapi/pull/12389) by [brouberol](https://github.com/brouberol).
* 🔧 Remove `base_path` for `mdx_include` Markdown extension in MkDocs. PR [12391](https://github.com/fastapi/fastapi/pull/12391) by [tiangolo](https://github.com/tiangolo).
* 📝 Update link to Swagger UI configuration docs. PR [12264](https://github.com/fastapi/fastapi/pull/12264) by [makisukurisu](https://github.com/makisukurisu).
* 📝 Adding links for Playwright and Vite in `docs/project-generation.md`. PR [12274](https://github.com/fastapi/fastapi/pull/12274) by [kayqueGovetri](https://github.com/kayqueGovetri).
* 📝 Fix small typos in the documentation. PR [12213](https://github.com/fastapi/fastapi/pull/12213) by [svlandeg](https://github.com/svlandeg).

Translations

* 🌐 Add Portuguese translation for `docs/pt/docs/tutorial/cookie-param-models.md`. PR [12298](https://github.com/fastapi/fastapi/pull/12298) by [ceb10n](https://github.com/ceb10n).
* 🌐 Add Portuguese translation for `docs/pt/docs/how-to/graphql.md`. PR [12215](https://github.com/fastapi/fastapi/pull/12215) by [AnandaCampelo](https://github.com/AnandaCampelo).
* 🌐 Add Portuguese translation for `docs/pt/docs/advanced/security/oauth2-scopes.md`. PR [12263](https://github.com/fastapi/fastapi/pull/12263) by [ceb10n](https://github.com/ceb10n).
* 🌐 Add Portuguese translation for `docs/pt/docs/deployment/concepts.md`. PR [12219](https://github.com/fastapi/fastapi/pull/12219) by [marcelomarkus](https://github.com/marcelomarkus).
* 🌐 Add Portuguese translation for `docs/pt/docs/how-to/conditional-openapi.md`. PR [12221](https://github.com/fastapi/fastapi/pull/12221) by [marcelomarkus](https://github.com/marcelomarkus).
* 🌐 Add Portuguese translation for `docs/pt/docs/advanced/response-directly.md`. PR [12266](https://github.com/fastapi/fastapi/pull/12266) by [Joao-Pedro-P-Holanda](https://github.com/Joao-Pedro-P-Holanda).
* 🌐 Update Portuguese translation for `docs/pt/docs/tutorial/cookie-params.md`. PR [12297](https://github.com/fastapi/fastapi/pull/12297) by [ceb10n](https://github.com/ceb10n).
* 🌐 Fix Korean translation for `docs/ko/docs/tutorial/index.md`. PR [12278](https://github.com/fastapi/fastapi/pull/12278) by [kkotipy](https://github.com/kkotipy).
* 🌐 Update Portuguese translation for `docs/pt/docs/advanced/security/http-basic-auth.md`. PR [12275](https://github.com/fastapi/fastapi/pull/12275) by [andersonrocha0](https://github.com/andersonrocha0).
* 🌐 Add Portuguese translation for `docs/pt/docs/deployment/cloud.md`. PR [12217](https://github.com/fastapi/fastapi/pull/12217) by [marcelomarkus](https://github.com/marcelomarkus).
* ✏️ Fix typo in `docs/es/docs/python-types.md`. PR [12235](https://github.com/fastapi/fastapi/pull/12235) by [JavierSanchezCastro](https://github.com/JavierSanchezCastro).
* 🌐 Add Dutch translation for `docs/nl/docs/environment-variables.md`. PR [12200](https://github.com/fastapi/fastapi/pull/12200) by [maxscheijen](https://github.com/maxscheijen).
* 🌐 Add Portuguese translation for `docs/pt/docs/deployment/manually.md`. PR [12210](https://github.com/fastapi/fastapi/pull/12210) by [JoaoGustavoRogel](https://github.com/JoaoGustavoRogel).
* 🌐 Add Portuguese translation for `docs/pt/docs/deployment/server-workers.md`. PR [12220](https://github.com/fastapi/fastapi/pull/12220) by [marcelomarkus](https://github.com/marcelomarkus).
* 🌐 Add Portuguese translation for `docs/pt/docs/how-to/configure-swagger-ui.md`. PR [12222](https://github.com/fastapi/fastapi/pull/12222) by [marcelomarkus](https://github.com/marcelomarkus).

Internal

* ⬆ [pre-commit.ci] pre-commit autoupdate. PR [12396](https://github.com/fastapi/fastapi/pull/12396) by [pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
* 🔨 Add script to generate variants of files. PR [12405](https://github.com/fastapi/fastapi/pull/12405) by [tiangolo](https://github.com/tiangolo).
* 🔧 Add speakeasy-api to `sponsors_badge.yml`. PR [12404](https://github.com/fastapi/fastapi/pull/12404) by [tiangolo](https://github.com/tiangolo).
* ➕ Add docs dependency: markdown-include-variants. PR [12399](https://github.com/fastapi/fastapi/pull/12399) by [tiangolo](https://github.com/tiangolo).
* 📝 Fix extra mdx-base-path paths. PR [12397](https://github.com/fastapi/fastapi/pull/12397) by [tiangolo](https://github.com/tiangolo).
* 👷 Tweak labeler to not override custom labels. PR [12398](https://github.com/fastapi/fastapi/pull/12398) by [tiangolo](https://github.com/tiangolo).
* 👷 Update worfkow deploy-docs-notify URL. PR [12392](https://github.com/fastapi/fastapi/pull/12392) by [tiangolo](https://github.com/tiangolo).
* 👷 Update Cloudflare GitHub Action. PR [12387](https://github.com/fastapi/fastapi/pull/12387) by [tiangolo](https://github.com/tiangolo).
* ⬆ Bump pypa/gh-action-pypi-publish from 1.10.1 to 1.10.3. PR [12386](https://github.com/fastapi/fastapi/pull/12386) by [dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump mkdocstrings[python] from 0.25.1 to 0.26.1. PR [12371](https://github.com/fastapi/fastapi/pull/12371) by [dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump griffe-typingdoc from 0.2.6 to 0.2.7. PR [12370](https://github.com/fastapi/fastapi/pull/12370) by [dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ [pre-commit.ci] pre-commit autoupdate. PR [12331](https://github.com/fastapi/fastapi/pull/12331) by [pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
* 🔧 Update sponsors, remove Fine.dev. PR [12271](https://github.com/fastapi/fastapi/pull/12271) by [tiangolo](https://github.com/tiangolo).
* ⬆ [pre-commit.ci] pre-commit autoupdate. PR [12253](https://github.com/fastapi/fastapi/pull/12253) by [pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
* ✏️ Fix docstring typos in http security. PR [12223](https://github.com/fastapi/fastapi/pull/12223) by [albertvillanova](https://github.com/albertvillanova).

0.115.0

Highlights

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

`Query` Parameter Models

Use Pydantic models for `Query` parameters:

python
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](https://fastapi.tiangolo.com/tutorial/query-param-models/).

`Header` Parameter Models

Use Pydantic models for `Header` parameters:

python
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](https://fastapi.tiangolo.com/tutorial/header-param-models/).

`Cookie` Parameter Models

Use Pydantic models for `Cookie` parameters:

python
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](https://fastapi.tiangolo.com/tutorial/cookie-param-models/).

Forbid Extra Query (Cookie, Header) Parameters

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"}`:

python
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:

* [Forbid Extra Query Parameters](https://fastapi.tiangolo.com/tutorial/query-param-models/#forbid-extra-query-parameters)
* [Forbid Extra Headers](https://fastapi.tiangolo.com/tutorial/header-param-models/#forbid-extra-headers)
* [Forbid Extra Cookies](https://fastapi.tiangolo.com/tutorial/cookie-param-models/#forbid-extra-cookies)

Features

* ✨ Add support for Pydantic models for parameters using `Query`, `Cookie`, `Header`. PR [12199](https://github.com/fastapi/fastapi/pull/12199) by [tiangolo](https://github.com/tiangolo).

Translations

* 🌐 Add Portuguese translation for `docs/pt/docs/advanced/security/http-basic-auth.md`. PR [12195](https://github.com/fastapi/fastapi/pull/12195) by [ceb10n](https://github.com/ceb10n).

Internal

* ⬆ [pre-commit.ci] pre-commit autoupdate. PR [12204](https://github.com/fastapi/fastapi/pull/12204) by [pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).

0.114.2

Fixes

* 🐛 Fix form field regression with `alias`. PR [12194](https://github.com/fastapi/fastapi/pull/12194) by [Wurstnase](https://github.com/Wurstnase).

Translations

* 🌐 Add Portuguese translation for `docs/pt/docs/tutorial/request-form-models.md`. PR [12175](https://github.com/fastapi/fastapi/pull/12175) by [ceb10n](https://github.com/ceb10n).
* 🌐 Add Chinese translation for `docs/zh/docs/project-generation.md`. PR [12170](https://github.com/fastapi/fastapi/pull/12170) by [waketzheng](https://github.com/waketzheng).
* 🌐 Add Dutch translation for `docs/nl/docs/python-types.md`. PR [12158](https://github.com/fastapi/fastapi/pull/12158) by [maxscheijen](https://github.com/maxscheijen).

Internal

* 💡 Add comments with instructions for Playwright screenshot scripts. PR [12193](https://github.com/fastapi/fastapi/pull/12193) by [tiangolo](https://github.com/tiangolo).
* ➕ Add inline-snapshot for tests. PR [12189](https://github.com/fastapi/fastapi/pull/12189) by [tiangolo](https://github.com/tiangolo).

0.114.1

Refactors

* ⚡️ Improve performance in request body parsing with a cache for internal model fields. PR [12184](https://github.com/fastapi/fastapi/pull/12184) by [tiangolo](https://github.com/tiangolo).

Docs

* 📝 Remove duplicate line in docs for `docs/en/docs/environment-variables.md`. PR [12169](https://github.com/fastapi/fastapi/pull/12169) by [prometek](https://github.com/prometek).

Translations

* 🌐 Add Portuguese translation for `docs/pt/docs/virtual-environments.md`. PR [12163](https://github.com/fastapi/fastapi/pull/12163) by [marcelomarkus](https://github.com/marcelomarkus).
* 🌐 Add Portuguese translation for `docs/pt/docs/environment-variables.md`. PR [12162](https://github.com/fastapi/fastapi/pull/12162) by [marcelomarkus](https://github.com/marcelomarkus).
* 🌐 Add Portuguese translation for `docs/pt/docs/tutorial/testing.md`. PR [12164](https://github.com/fastapi/fastapi/pull/12164) by [marcelomarkus](https://github.com/marcelomarkus).
* 🌐 Add Portuguese translation for `docs/pt/docs/tutorial/debugging.md`. PR [12165](https://github.com/fastapi/fastapi/pull/12165) by [marcelomarkus](https://github.com/marcelomarkus).
* 🌐 Add Korean translation for `docs/ko/docs/project-generation.md`. PR [12157](https://github.com/fastapi/fastapi/pull/12157) by [BORA040126](https://github.com/BORA040126).

Internal

* ⬆ Bump tiangolo/issue-manager from 0.5.0 to 0.5.1. PR [12173](https://github.com/fastapi/fastapi/pull/12173) by [dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ [pre-commit.ci] pre-commit autoupdate. PR [12176](https://github.com/fastapi/fastapi/pull/12176) by [pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
* 👷 Update `issue-manager.yml`. PR [12159](https://github.com/fastapi/fastapi/pull/12159) by [tiangolo](https://github.com/tiangolo).
* ✏️ Fix typo in `fastapi/params.py`. PR [12143](https://github.com/fastapi/fastapi/pull/12143) by [surreal30](https://github.com/surreal30).

0.114.0

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"}`:

python
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](https://fastapi.tiangolo.com/tutorial/request-form-models/#forbid-extra-form-fields).

Features

* ✨ Add support for forbidding extra form fields with Pydantic models. PR [12134](https://github.com/fastapi/fastapi/pull/12134) by [tiangolo](https://github.com/tiangolo).

Docs

* 📝 Update docs, Form Models section title, to match config name. PR [12152](https://github.com/fastapi/fastapi/pull/12152) by [tiangolo](https://github.com/tiangolo).

Internal

* ✅ Update internal tests for latest Pydantic, including CI tweaks to install the latest Pydantic. PR [12147](https://github.com/fastapi/fastapi/pull/12147) by [tiangolo](https://github.com/tiangolo).

0.113.0

Now you can declare form fields with Pydantic models:

python
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](https://fastapi.tiangolo.com/tutorial/request-form-models/).

Features

* ✨ Add support for Pydantic models in `Form` parameters. PR [12129](https://github.com/fastapi/fastapi/pull/12129) by [tiangolo](https://github.com/tiangolo).

Internal

* 🔧 Update sponsors: Coherence link. PR [12130](https://github.com/fastapi/fastapi/pull/12130) by [tiangolo](https://github.com/tiangolo).

Page 3 of 35

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.