Fastapi

Latest version: v0.115.11

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

Scan your dependencies

Page 14 of 34

0.79.0

Not secure
Fixes - Breaking Changes

* 🐛 Fix removing body from status codes that do not support it. PR [5145](https://github.com/tiangolo/fastapi/pull/5145) by [tiangolo](https://github.com/tiangolo).
* Setting `status_code` to `204`, `304`, or any code below `200` (1xx) will remove the body from the response.
* This fixes an error in Uvicorn that otherwise would be thrown: `RuntimeError: Response content longer than Content-Length`.
* This removes `fastapi.openapi.constants.STATUS_CODES_WITH_NO_BODY`, it is replaced by a function in utils.

Translations

* 🌐 Start of Hebrew translation. PR [5050](https://github.com/tiangolo/fastapi/pull/5050) by [itay-raveh](https://github.com/itay-raveh).
* 🔧 Add config for Swedish translations notification. PR [5147](https://github.com/tiangolo/fastapi/pull/5147) by [tiangolo](https://github.com/tiangolo).
* 🌐 Start of Swedish translation. PR [5062](https://github.com/tiangolo/fastapi/pull/5062) by [MrRawbin](https://github.com/MrRawbin).
* 🌐 Add Japanese translation for `docs/ja/docs/advanced/index.md`. PR [5043](https://github.com/tiangolo/fastapi/pull/5043) by [wakabame](https://github.com/wakabame).
* 🌐🇵🇱 Add Polish translation for `docs/pl/docs/tutorial/first-steps.md`. PR [5024](https://github.com/tiangolo/fastapi/pull/5024) by [Valaraucoo](https://github.com/Valaraucoo).

Internal

* 🔧 Update translations notification for Hebrew. PR [5158](https://github.com/tiangolo/fastapi/pull/5158) by [tiangolo](https://github.com/tiangolo).
* 🔧 Update Dependabot commit message. PR [5156](https://github.com/tiangolo/fastapi/pull/5156) by [tiangolo](https://github.com/tiangolo).
* ⬆ Bump actions/upload-artifact from 2 to 3. PR [5148](https://github.com/tiangolo/fastapi/pull/5148) by [dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump actions/cache from 2 to 3. PR [5149](https://github.com/tiangolo/fastapi/pull/5149) by [dependabot[bot]](https://github.com/apps/dependabot).
* 🔧 Update sponsors badge configs. PR [5155](https://github.com/tiangolo/fastapi/pull/5155) by [tiangolo](https://github.com/tiangolo).
* 👥 Update FastAPI People. PR [5154](https://github.com/tiangolo/fastapi/pull/5154) by [tiangolo](https://github.com/tiangolo).
* 🔧 Update Jina sponsor badges. PR [5151](https://github.com/tiangolo/fastapi/pull/5151) by [tiangolo](https://github.com/tiangolo).
* ⬆ Bump actions/checkout from 2 to 3. PR [5133](https://github.com/tiangolo/fastapi/pull/5133) by [dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ [pre-commit.ci] pre-commit autoupdate. PR [5030](https://github.com/tiangolo/fastapi/pull/5030) by [pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
* ⬆ Bump nwtgck/actions-netlify from 1.1.5 to 1.2.3. PR [5132](https://github.com/tiangolo/fastapi/pull/5132) by [dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump codecov/codecov-action from 2 to 3. PR [5131](https://github.com/tiangolo/fastapi/pull/5131) by [dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump dawidd6/action-download-artifact from 2.9.0 to 2.21.1. PR [5130](https://github.com/tiangolo/fastapi/pull/5130) by [dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump actions/setup-python from 2 to 4. PR [5129](https://github.com/tiangolo/fastapi/pull/5129) by [dependabot[bot]](https://github.com/apps/dependabot).
* 👷 Add Dependabot. PR [5128](https://github.com/tiangolo/fastapi/pull/5128) by [tiangolo](https://github.com/tiangolo).
* ♻️ Move from `Optional[X]` to `Union[X, None]` for internal utils. PR [5124](https://github.com/tiangolo/fastapi/pull/5124) by [tiangolo](https://github.com/tiangolo).
* 🔧 Update sponsors, remove Dropbase, add Doist. PR [5096](https://github.com/tiangolo/fastapi/pull/5096) by [tiangolo](https://github.com/tiangolo).
* 🔧 Update sponsors, remove Classiq, add ImgWhale. PR [5079](https://github.com/tiangolo/fastapi/pull/5079) by [tiangolo](https://github.com/tiangolo).

0.78.0

Not secure
Features

* ✨ Add support for omitting `...` as default value when declaring required parameters with:

* `Path()`
* `Query()`
* `Header()`
* `Cookie()`
* `Body()`
* `Form()`
* `File()`

New docs at [Tutorial - Query Parameters and String Validations - Make it required](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#make-it-required). PR [4906](https://github.com/tiangolo/fastapi/pull/4906) by [tiangolo](https://github.com/tiangolo).

Up to now, declaring a required parameter while adding additional validation or metadata needed using `...` (Ellipsis).

For example:

Python
from fastapi import Cookie, FastAPI, Header, Path, Query

app = FastAPI()


app.get("/items/{item_id}")
def main(
item_id: int = Path(default=..., gt=0),
query: str = Query(default=..., max_length=10),
session: str = Cookie(default=..., min_length=3),
x_trace: str = Header(default=..., title="Tracing header"),
):
return {"message": "Hello World"}


...all these parameters are required because the default value is `...` (Ellipsis).

But now it's possible and supported to just omit the default value, as would be done with Pydantic fields, and the parameters would still be required.

✨ For example, this is now supported:

Python
from fastapi import Cookie, FastAPI, Header, Path, Query

app = FastAPI()


app.get("/items/{item_id}")
def main(
item_id: int = Path(gt=0),
query: str = Query(max_length=10),
session: str = Cookie(min_length=3),
x_trace: str = Header(title="Tracing header"),
):
return {"message": "Hello World"}


To declare parameters as optional (not required), you can set a default value as always, for example using `None`:

Python
from typing import Union
from fastapi import Cookie, FastAPI, Header, Path, Query

app = FastAPI()


app.get("/items/{item_id}")
def main(
item_id: int = Path(gt=0),
query: Union[str, None] = Query(default=None, max_length=10),
session: Union[str, None] = Cookie(default=None, min_length=3),
x_trace: Union[str, None] = Header(default=None, title="Tracing header"),
):
return {"message": "Hello World"}


Docs

* 📝 Add docs recommending `Union` over `Optional` and migrate source examples. New docs at [Python Types Intro - Using `Union` or `Optional`](https://fastapi.tiangolo.com/python-types/#using-union-or-optional). PR [4908](https://github.com/tiangolo/fastapi/pull/4908) by [tiangolo](https://github.com/tiangolo).
* 🎨 Fix default value as set in tutorial for Path Operations Advanced Configurations. PR [4899](https://github.com/tiangolo/fastapi/pull/4899) by [tiangolo](https://github.com/tiangolo).
* 📝 Add documentation for redefined path operations. PR [4864](https://github.com/tiangolo/fastapi/pull/4864) by [madkinsz](https://github.com/madkinsz).
* 📝 Updates links for Celery documentation. PR [4736](https://github.com/tiangolo/fastapi/pull/4736) by [sammyzord](https://github.com/sammyzord).
* ✏ Fix example code with sets in tutorial for body nested models. PR [3030](https://github.com/tiangolo/fastapi/pull/3030) by [hitrust](https://github.com/hitrust).
* ✏ Fix links to Pydantic docs. PR [4670](https://github.com/tiangolo/fastapi/pull/4670) by [kinuax](https://github.com/kinuax).
* 📝 Update docs about Swagger UI self-hosting with newer source links. PR [4813](https://github.com/tiangolo/fastapi/pull/4813) by [Kastakin](https://github.com/Kastakin).
* 📝 Add link to external article: Building the Poll App From Django Tutorial With FastAPI And React. PR [4778](https://github.com/tiangolo/fastapi/pull/4778) by [jbrocher](https://github.com/jbrocher).
* 📝 Add OpenAPI warning to "Body - Fields" docs with extra schema extensions. PR [4846](https://github.com/tiangolo/fastapi/pull/4846) by [ml-evs](https://github.com/ml-evs).

Translations

* 🌐 Fix code examples in Japanese translation for `docs/ja/docs/tutorial/testing.md`. PR [4623](https://github.com/tiangolo/fastapi/pull/4623) by [hirotoKirimaru](https://github.com/hirotoKirimaru).

Internal

* ♻ Refactor dict value extraction to minimize key lookups `fastapi/utils.py`. PR [3139](https://github.com/tiangolo/fastapi/pull/3139) by [ShahriyarR](https://github.com/ShahriyarR).
* ✅ Add tests for required nonable parameters and body fields. PR [4907](https://github.com/tiangolo/fastapi/pull/4907) by [tiangolo](https://github.com/tiangolo).
* 👷 Fix installing Material for MkDocs Insiders in CI. PR [4897](https://github.com/tiangolo/fastapi/pull/4897) by [tiangolo](https://github.com/tiangolo).
* 👷 Add pre-commit CI instead of custom GitHub Action. PR [4896](https://github.com/tiangolo/fastapi/pull/4896) by [tiangolo](https://github.com/tiangolo).
* 👷 Add pre-commit GitHub Action workflow. PR [4895](https://github.com/tiangolo/fastapi/pull/4895) by [tiangolo](https://github.com/tiangolo).
* 📝 Add dark mode auto switch to docs based on OS preference. PR [4869](https://github.com/tiangolo/fastapi/pull/4869) by [ComicShrimp](https://github.com/ComicShrimp).
* 🔥 Remove un-used old pending tests, already covered in other places. PR [4891](https://github.com/tiangolo/fastapi/pull/4891) by [tiangolo](https://github.com/tiangolo).
* 🔧 Add Python formatting hooks to pre-commit. PR [4890](https://github.com/tiangolo/fastapi/pull/4890) by [tiangolo](https://github.com/tiangolo).
* 🔧 Add pre-commit with first config and first formatting pass. PR [4888](https://github.com/tiangolo/fastapi/pull/4888) by [tiangolo](https://github.com/tiangolo).
* 👷 Disable CI installing Material for MkDocs in forks. PR [4410](https://github.com/tiangolo/fastapi/pull/4410) by [dolfinus](https://github.com/dolfinus).

0.77.1

Not secure
Upgrades

* ⬆ Upgrade Starlette from 0.19.0 to 0.19.1. PR [4819](https://github.com/tiangolo/fastapi/pull/4819) by [Kludex](https://github.com/Kludex).

Docs

* 📝 Add link to german article: REST-API Programmieren mittels Python und dem FastAPI Modul. PR [4624](https://github.com/tiangolo/fastapi/pull/4624) by [fschuermeyer](https://github.com/fschuermeyer).
* 📝 Add external link: PyCharm Guide to FastAPI. PR [4512](https://github.com/tiangolo/fastapi/pull/4512) by [mukulmantosh](https://github.com/mukulmantosh).
* 📝 Add external link to article: Building an API with FastAPI and Supabase and Deploying on Deta. PR [4440](https://github.com/tiangolo/fastapi/pull/4440) by [aUnicornDev](https://github.com/aUnicornDev).
* ✏ Fix small typo in `docs/en/docs/tutorial/security/first-steps.md`. PR [4515](https://github.com/tiangolo/fastapi/pull/4515) by [KikoIlievski](https://github.com/KikoIlievski).

Translations

* 🌐 Add Polish translation for `docs/pl/docs/tutorial/index.md`. PR [4516](https://github.com/tiangolo/fastapi/pull/4516) by [MKaczkow](https://github.com/MKaczkow).
* ✏ Fix typo in deployment. PR [4629](https://github.com/tiangolo/fastapi/pull/4629) by [raisulislam541](https://github.com/raisulislam541).
* 🌐 Add Portuguese translation for `docs/pt/docs/help-fastapi.md`. PR [4583](https://github.com/tiangolo/fastapi/pull/4583) by [mateusjs](https://github.com/mateusjs).

Internal

* 🔧 Add notifications in issue for Uzbek translations. PR [4884](https://github.com/tiangolo/fastapi/pull/4884) by [tiangolo](https://github.com/tiangolo).

0.77.0

Not secure
Upgrades

* ⬆ Upgrade Starlette from 0.18.0 to 0.19.0. PR [4488](https://github.com/tiangolo/fastapi/pull/4488) by [Kludex](https://github.com/Kludex).
* When creating an explicit `JSONResponse` the `content` argument is now required.

Docs

* 📝 Add external link to article: Seamless FastAPI Configuration with ConfZ. PR [4414](https://github.com/tiangolo/fastapi/pull/4414) by [silvanmelchior](https://github.com/silvanmelchior).
* 📝 Add external link to article: 5 Advanced Features of FastAPI You Should Try. PR [4436](https://github.com/tiangolo/fastapi/pull/4436) by [kaustubhgupta](https://github.com/kaustubhgupta).
* ✏ Reword to improve legibility of docs about `TestClient`. PR [4389](https://github.com/tiangolo/fastapi/pull/4389) by [rgilton](https://github.com/rgilton).
* 📝 Add external link to blog post about Kafka, FastAPI, and Ably. PR [4044](https://github.com/tiangolo/fastapi/pull/4044) by [Ugbot](https://github.com/Ugbot).
* ✏ Fix typo in `docs/en/docs/tutorial/sql-databases.md`. PR [4875](https://github.com/tiangolo/fastapi/pull/4875) by [wpyoga](https://github.com/wpyoga).
* ✏ Fix typo in `docs/en/docs/async.md`. PR [4726](https://github.com/tiangolo/fastapi/pull/4726) by [Prezu](https://github.com/Prezu).

Translations

* 🌐 Update source example highlights for `docs/zh/docs/tutorial/query-params-str-validations.md`. PR [4237](https://github.com/tiangolo/fastapi/pull/4237) by [caimaoy](https://github.com/caimaoy).
* 🌐 Remove translation docs references to aiofiles as it's no longer needed since AnyIO. PR [3594](https://github.com/tiangolo/fastapi/pull/3594) by [alonme](https://github.com/alonme).
* ✏ 🌐 Fix typo in Portuguese translation for `docs/pt/docs/tutorial/path-params.md`. PR [4722](https://github.com/tiangolo/fastapi/pull/4722) by [CleoMenezesJr](https://github.com/CleoMenezesJr).
* 🌐 Fix live docs server for translations for some languages. PR [4729](https://github.com/tiangolo/fastapi/pull/4729) by [wakabame](https://github.com/wakabame).
* 🌐 Add Portuguese translation for `docs/pt/docs/tutorial/cookie-params.md`. PR [4112](https://github.com/tiangolo/fastapi/pull/4112) by [lbmendes](https://github.com/lbmendes).
* 🌐 Fix French translation for `docs/tutorial/body.md`. PR [4332](https://github.com/tiangolo/fastapi/pull/4332) by [Smlep](https://github.com/Smlep).
* 🌐 Add Japanese translation for `docs/ja/docs/advanced/conditional-openapi.md`. PR [2631](https://github.com/tiangolo/fastapi/pull/2631) by [sh0nk](https://github.com/sh0nk).
* 🌐 Fix Japanese translation of `docs/ja/docs/tutorial/body.md`. PR [3062](https://github.com/tiangolo/fastapi/pull/3062) by [a-takahashi223](https://github.com/a-takahashi223).
* 🌐 Add Portuguese translation for `docs/pt/docs/tutorial/background-tasks.md`. PR [2170](https://github.com/tiangolo/fastapi/pull/2170) by [izaguerreiro](https://github.com/izaguerreiro).
* 🌐 Add Portuguese translation for `docs/deployment/deta.md`. PR [4442](https://github.com/tiangolo/fastapi/pull/4442) by [lsglucas](https://github.com/lsglucas).
* 🌐 Add Russian translation for `docs/async.md`. PR [4036](https://github.com/tiangolo/fastapi/pull/4036) by [Winand](https://github.com/Winand).
* 🌐 Add Portuguese translation for `docs/tutorial/body.md`. PR [3960](https://github.com/tiangolo/fastapi/pull/3960) by [leandrodesouzadev](https://github.com/leandrodesouzadev).
* 🌐 Add Portuguese translation of `tutorial/extra-data-types.md`. PR [4077](https://github.com/tiangolo/fastapi/pull/4077) by [luccasmmg](https://github.com/luccasmmg).
* 🌐 Update German translation for `docs/features.md`. PR [3905](https://github.com/tiangolo/fastapi/pull/3905) by [jomue](https://github.com/jomue).

0.76.0

Not secure
Upgrades

* ⬆ Upgrade Starlette from 0.17.1 to 0.18.0. PR [4483](https://github.com/tiangolo/fastapi/pull/4483) by [Kludex](https://github.com/Kludex).

Internal

* 👥 Update FastAPI People. PR [4847](https://github.com/tiangolo/fastapi/pull/4847) by [github-actions[bot]](https://github.com/apps/github-actions).
* 🔧 Add Budget Insight sponsor. PR [4824](https://github.com/tiangolo/fastapi/pull/4824) by [tiangolo](https://github.com/tiangolo).
* 🍱 Update sponsor, ExoFlare badge. PR [4822](https://github.com/tiangolo/fastapi/pull/4822) by [tiangolo](https://github.com/tiangolo).
* 🔧 Update sponsors, enable Dropbase again, update TalkPython link. PR [4821](https://github.com/tiangolo/fastapi/pull/4821) by [tiangolo](https://github.com/tiangolo).

0.75.2

Not secure
This release includes upgrades to third-party packages that handle security issues. Although there's a chance these issues don't affect you in particular, please upgrade as soon as possible.

Fixes

* ✅ Fix new/recent tests with new fixed `ValidationError` JSON Schema. PR [4806](https://github.com/tiangolo/fastapi/pull/4806) by [tiangolo](https://github.com/tiangolo).
* 🐛 Fix JSON Schema for `ValidationError` at field `loc`. PR [3810](https://github.com/tiangolo/fastapi/pull/3810) by [dconathan](https://github.com/dconathan).
* 🐛 Fix support for prefix on APIRouter WebSockets. PR [2640](https://github.com/tiangolo/fastapi/pull/2640) by [Kludex](https://github.com/Kludex).

Upgrades

* ⬆️ Update ujson ranges for CVE-2021-45958. PR [4804](https://github.com/tiangolo/fastapi/pull/4804) by [tiangolo](https://github.com/tiangolo).
* ⬆️ Upgrade dependencies upper range for extras "all". PR [4803](https://github.com/tiangolo/fastapi/pull/4803) by [tiangolo](https://github.com/tiangolo).
* ⬆ Upgrade Swagger UI - swagger-ui-dist4. This handles a security issue in Swagger UI itself where it could be possible to inject HTML into Swagger UI. Please upgrade as soon as you can, in particular if you expose your Swagger UI (`/docs`) publicly to non-expert users. PR [4347](https://github.com/tiangolo/fastapi/pull/4347) by [RAlanWright](https://github.com/RAlanWright).

Internal

* 🔧 Update sponsors, add: ExoFlare, Ines Course; remove: Dropbase, Vim.so, Calmcode; update: Striveworks, TalkPython and TestDriven.io. PR [4805](https://github.com/tiangolo/fastapi/pull/4805) by [tiangolo](https://github.com/tiangolo).
* ⬆️ Upgrade Codecov GitHub Action. PR [4801](https://github.com/tiangolo/fastapi/pull/4801) by [tiangolo](https://github.com/tiangolo).

Page 14 of 34

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.