Fastapi

Latest version: v0.111.0

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

Scan your dependencies

Page 4 of 31

0.102.0

Not secure
Features

* ✨ Add support for disabling the separation of input and output JSON Schemas in OpenAPI with Pydantic v2 with `separate_input_output_schemas=False`. PR [10145](https://github.com/tiangolo/fastapi/pull/10145) by [tiangolo](https://github.com/tiangolo).
* New docs [Separate OpenAPI Schemas for Input and Output or Not](https://fastapi.tiangolo.com/how-to/separate-openapi-schemas/).
* This PR also includes a new setup (internal tools) for generating screenshots for the docs.

Refactors

* ♻️ Refactor tests for new Pydantic 2.2.1. PR [10115](https://github.com/tiangolo/fastapi/pull/10115) by [tiangolo](https://github.com/tiangolo).

Docs

* 📝 Add new docs section, How To - Recipes, move docs that don't have to be read by everyone to How To. PR [10114](https://github.com/tiangolo/fastapi/pull/10114) by [tiangolo](https://github.com/tiangolo).
* 📝 Update Advanced docs, add links to sponsor courses. PR [10113](https://github.com/tiangolo/fastapi/pull/10113) by [tiangolo](https://github.com/tiangolo).
* 📝 Update docs for generating clients. PR [10112](https://github.com/tiangolo/fastapi/pull/10112) by [tiangolo](https://github.com/tiangolo).
* 📝 Tweak MkDocs and add redirects. PR [10111](https://github.com/tiangolo/fastapi/pull/10111) by [tiangolo](https://github.com/tiangolo).
* 📝 Restructure docs for cloud providers, include links to sponsors. PR [10110](https://github.com/tiangolo/fastapi/pull/10110) by [tiangolo](https://github.com/tiangolo).

Internal

* 🔧 Update sponsors, add Speakeasy. PR [10098](https://github.com/tiangolo/fastapi/pull/10098) by [tiangolo](https://github.com/tiangolo).

0.101.1

Not secure
Fixes

* ✨ Add `ResponseValidationError` printable details, to show up in server error logs. PR [10078](https://github.com/tiangolo/fastapi/pull/10078) by [tiangolo](https://github.com/tiangolo).

Refactors

* ✏️ Fix typo in deprecation warnings in `fastapi/params.py`. PR [9854](https://github.com/tiangolo/fastapi/pull/9854) by [russbiggs](https://github.com/russbiggs).
* ✏️ Fix typos in comments on internal code in `fastapi/concurrency.py` and `fastapi/routing.py`. PR [9590](https://github.com/tiangolo/fastapi/pull/9590) by [ElliottLarsen](https://github.com/ElliottLarsen).

Docs

* ✏️ Fix typo in release notes. PR [9835](https://github.com/tiangolo/fastapi/pull/9835) by [francisbergin](https://github.com/francisbergin).
* 📝 Add external article: Build an SMS Spam Classifier Serverless Database with FaunaDB and FastAPI. PR [9847](https://github.com/tiangolo/fastapi/pull/9847) by [adejumoridwan](https://github.com/adejumoridwan).
* 📝 Fix typo in `docs/en/docs/contributing.md`. PR [9878](https://github.com/tiangolo/fastapi/pull/9878) by [VicenteMerino](https://github.com/VicenteMerino).
* 📝 Fix code highlighting in `docs/en/docs/tutorial/bigger-applications.md`. PR [9806](https://github.com/tiangolo/fastapi/pull/9806) by [theonlykingpin](https://github.com/theonlykingpin).

Translations

* 🌐 Add Japanese translation for `docs/ja/docs/deployment/concepts.md`. PR [10062](https://github.com/tiangolo/fastapi/pull/10062) by [tamtam-fitness](https://github.com/tamtam-fitness).
* 🌐 Add Japanese translation for `docs/ja/docs/deployment/server-workers.md`. PR [10064](https://github.com/tiangolo/fastapi/pull/10064) by [tamtam-fitness](https://github.com/tamtam-fitness).
* 🌐 Update Japanese translation for `docs/ja/docs/deployment/docker.md`. PR [10073](https://github.com/tiangolo/fastapi/pull/10073) by [tamtam-fitness](https://github.com/tamtam-fitness).
* 🌐 Add Ukrainian translation for `docs/uk/docs/fastapi-people.md`. PR [10059](https://github.com/tiangolo/fastapi/pull/10059) by [rostik1410](https://github.com/rostik1410).
* 🌐 Add Ukrainian translation for `docs/uk/docs/tutorial/cookie-params.md`. PR [10032](https://github.com/tiangolo/fastapi/pull/10032) by [rostik1410](https://github.com/rostik1410).
* 🌐 Add Russian translation for `docs/ru/docs/deployment/docker.md`. PR [9971](https://github.com/tiangolo/fastapi/pull/9971) by [Xewus](https://github.com/Xewus).
* 🌐 Add Vietnamese translation for `docs/vi/docs/python-types.md`. PR [10047](https://github.com/tiangolo/fastapi/pull/10047) by [magiskboy](https://github.com/magiskboy).
* 🌐 Add Russian translation for `docs/ru/docs/tutorial/dependencies/global-dependencies.md`. PR [9970](https://github.com/tiangolo/fastapi/pull/9970) by [dudyaosuplayer](https://github.com/dudyaosuplayer).
* 🌐 Add Urdu translation for `docs/ur/docs/benchmarks.md`. PR [9974](https://github.com/tiangolo/fastapi/pull/9974) by [AhsanSheraz](https://github.com/AhsanSheraz).

Internal

* 🔧 Add sponsor Porter. PR [10051](https://github.com/tiangolo/fastapi/pull/10051) by [tiangolo](https://github.com/tiangolo).
* 🔧 Update sponsors, add Jina back as bronze sponsor. PR [10050](https://github.com/tiangolo/fastapi/pull/10050) by [tiangolo](https://github.com/tiangolo).
* ⬆ Bump mypy from 1.4.0 to 1.4.1. PR [9756](https://github.com/tiangolo/fastapi/pull/9756) by [dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump mkdocs-material from 9.1.17 to 9.1.21. PR [9960](https://github.com/tiangolo/fastapi/pull/9960) by [dependabot[bot]](https://github.com/apps/dependabot).

0.101.0

Not secure
Features

* ✨ Enable Pydantic's serialization mode for responses, add support for Pydantic's `computed_field`, better OpenAPI for response models, proper required attributes, better generated clients. PR [10011](https://github.com/tiangolo/fastapi/pull/10011) by [tiangolo](https://github.com/tiangolo).

Refactors

* ✅ Fix tests for compatibility with pydantic 2.1.1. PR [9943](https://github.com/tiangolo/fastapi/pull/9943) by [dmontagu](https://github.com/dmontagu).
* ✅ Fix test error in Windows for `jsonable_encoder`. PR [9840](https://github.com/tiangolo/fastapi/pull/9840) by [iudeen](https://github.com/iudeen).

Upgrades

* 📌 Do not allow Pydantic 2.1.0 that breaks (require 2.1.1). PR [10012](https://github.com/tiangolo/fastapi/pull/10012) by [tiangolo](https://github.com/tiangolo).

Translations

* 🌐 Add Russian translation for `docs/ru/docs/tutorial/security/index.md`. PR [9963](https://github.com/tiangolo/fastapi/pull/9963) by [eVery1337](https://github.com/eVery1337).
* 🌐 Remove Vietnamese note about missing translation. PR [9957](https://github.com/tiangolo/fastapi/pull/9957) by [tiangolo](https://github.com/tiangolo).

Internal

* 👷 Add GitHub Actions step dump context to debug external failures. PR [10008](https://github.com/tiangolo/fastapi/pull/10008) by [tiangolo](https://github.com/tiangolo).
* 🔧 Restore MkDocs Material pin after the fix. PR [10001](https://github.com/tiangolo/fastapi/pull/10001) by [tiangolo](https://github.com/tiangolo).
* 🔧 Update the Question template to ask for the Pydantic version. PR [10000](https://github.com/tiangolo/fastapi/pull/10000) by [tiangolo](https://github.com/tiangolo).
* 📍 Update MkDocs Material dependencies. PR [9986](https://github.com/tiangolo/fastapi/pull/9986) by [tiangolo](https://github.com/tiangolo).
* 👥 Update FastAPI People. PR [9999](https://github.com/tiangolo/fastapi/pull/9999) by [tiangolo](https://github.com/tiangolo).
* 🐳 Update Dockerfile with compatibility versions, to upgrade later. PR [9998](https://github.com/tiangolo/fastapi/pull/9998) by [tiangolo](https://github.com/tiangolo).
* ➕ Add pydantic-settings to FastAPI People dependencies. PR [9988](https://github.com/tiangolo/fastapi/pull/9988) by [tiangolo](https://github.com/tiangolo).
* ♻️ Update FastAPI People logic with new Pydantic. PR [9985](https://github.com/tiangolo/fastapi/pull/9985) by [tiangolo](https://github.com/tiangolo).
* 🍱 Update sponsors, Fern badge. PR [9982](https://github.com/tiangolo/fastapi/pull/9982) by [tiangolo](https://github.com/tiangolo).
* 👷 Deploy docs to Cloudflare Pages. PR [9978](https://github.com/tiangolo/fastapi/pull/9978) by [tiangolo](https://github.com/tiangolo).
* 🔧 Update sponsor Fern. PR [9979](https://github.com/tiangolo/fastapi/pull/9979) by [tiangolo](https://github.com/tiangolo).
* 👷 Update CI debug mode with Tmate. PR [9977](https://github.com/tiangolo/fastapi/pull/9977) by [tiangolo](https://github.com/tiangolo).

0.100.1

Not secure
Fixes

* 🐛 Replace `MultHostUrl` to `AnyUrl` for compatibility with older versions of Pydantic v1. PR [9852](https://github.com/tiangolo/fastapi/pull/9852) by [Kludex](https://github.com/Kludex).

Docs

* 📝 Update links for self-hosted Swagger UI, point to v5, for OpenAPI 31.0. PR [9834](https://github.com/tiangolo/fastapi/pull/9834) by [tiangolo](https://github.com/tiangolo).

Translations

* 🌐 Add Ukrainian translation for `docs/uk/docs/tutorial/body.md`. PR [4574](https://github.com/tiangolo/fastapi/pull/4574) by [ss-o-furda](https://github.com/ss-o-furda).
* 🌐 Add Vietnamese translation for `docs/vi/docs/features.md` and `docs/vi/docs/index.md`. PR [3006](https://github.com/tiangolo/fastapi/pull/3006) by [magiskboy](https://github.com/magiskboy).
* 🌐 Add Korean translation for `docs/ko/docs/async.md`. PR [4179](https://github.com/tiangolo/fastapi/pull/4179) by [NinaHwang](https://github.com/NinaHwang).
* 🌐 Add Chinese translation for `docs/zh/docs/tutorial/background-tasks.md`. PR [9812](https://github.com/tiangolo/fastapi/pull/9812) by [wdh99](https://github.com/wdh99).
* 🌐 Add French translation for `docs/fr/docs/tutorial/query-params-str-validations.md`. PR [4075](https://github.com/tiangolo/fastapi/pull/4075) by [Smlep](https://github.com/Smlep).
* 🌐 Add French translation for `docs/fr/docs/tutorial/index.md`. PR [2234](https://github.com/tiangolo/fastapi/pull/2234) by [JulianMaurin](https://github.com/JulianMaurin).
* 🌐 Add French translation for `docs/fr/docs/contributing.md`. PR [2132](https://github.com/tiangolo/fastapi/pull/2132) by [JulianMaurin](https://github.com/JulianMaurin).
* 🌐 Add French translation for `docs/fr/docs/benchmarks.md`. PR [2155](https://github.com/tiangolo/fastapi/pull/2155) by [clemsau](https://github.com/clemsau).
* 🌐 Update Chinese translations with new source files. PR [9738](https://github.com/tiangolo/fastapi/pull/9738) by [mahone3297](https://github.com/mahone3297).
* 🌐 Add Russian translation for `docs/ru/docs/tutorial/request-forms.md`. PR [9841](https://github.com/tiangolo/fastapi/pull/9841) by [dedkot01](https://github.com/dedkot01).
* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/handling-errors.md`. PR [9485](https://github.com/tiangolo/fastapi/pull/9485) by [Creat55](https://github.com/Creat55).

Internal

* 🔧 Update sponsors, add Fern. PR [9956](https://github.com/tiangolo/fastapi/pull/9956) by [tiangolo](https://github.com/tiangolo).
* 👷 Update FastAPI People token. PR [9844](https://github.com/tiangolo/fastapi/pull/9844) by [tiangolo](https://github.com/tiangolo).
* 👥 Update FastAPI People. PR [9775](https://github.com/tiangolo/fastapi/pull/9775) by [tiangolo](https://github.com/tiangolo).
* 👷 Update MkDocs Material token. PR [9843](https://github.com/tiangolo/fastapi/pull/9843) by [tiangolo](https://github.com/tiangolo).
* 👷 Update token for latest changes. PR [9842](https://github.com/tiangolo/fastapi/pull/9842) by [tiangolo](https://github.com/tiangolo).

0.100.0

Not secure
✨ Support for **Pydantic v2** ✨

Pydantic version 2 has the **core** re-written in **Rust** and includes a lot of improvements and features, for example:

* Improved **correctness** in corner cases.
* **Safer** types.
* Better **performance** and **less energy** consumption.
* Better **extensibility**.
* etc.

...all this while keeping the **same Python API**. In most of the cases, for simple models, you can simply upgrade the Pydantic version and get all the benefits. 🚀

In some cases, for pure data validation and processing, you can get performance improvements of **20x** or more. This means 2,000% or more. 🤯

When you use **FastAPI**, there's a lot more going on, processing the request and response, handling dependencies, executing **your own code**, and particularly, **waiting for the network**. But you will probably still get some nice performance improvements just from the upgrade.

The focus of this release is **compatibility** with Pydantic v1 and v2, to make sure your current apps keep working. Later there will be more focus on refactors, correctness, code improvements, and then **performance** improvements. Some third-party early beta testers that ran benchmarks on the beta releases of FastAPI reported improvements of **2x - 3x**. Which is not bad for just doing `pip install --upgrade fastapi pydantic`. This was not an official benchmark and I didn't check it myself, but it's a good sign.

Migration

Check out the [Pydantic migration guide](https://docs.pydantic.dev/2.0/migration/).

For the things that need changes in your Pydantic models, the Pydantic team built [`bump-pydantic`](https://github.com/pydantic/bump-pydantic).

A command line tool that will **process your code** and update most of the things **automatically** for you. Make sure you have your code in git first, and review each of the changes to make sure everything is correct before committing the changes.

Pydantic v1

**This version of FastAPI still supports Pydantic v1**. And although Pydantic v1 will be deprecated at some point, ti will still be supported for a while.

This means that you can install the new Pydantic v2, and if something fails, you can install Pydantic v1 while you fix any problems you might have, but having the latest FastAPI.

There are **tests for both Pydantic v1 and v2**, and test **coverage** is kept at **100%**.

Changes

* There are **new parameter** fields supported by Pydantic `Field()` for:

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

* The new parameter fields are:

* `default_factory`
* `alias_priority`
* `validation_alias`
* `serialization_alias`
* `discriminator`
* `strict`
* `multiple_of`
* `allow_inf_nan`
* `max_digits`
* `decimal_places`
* `json_schema_extra`

...you can read about them in the Pydantic docs.

* The parameter `regex` has been deprecated and replaced by `pattern`.
* You can read more about it in the docs for [Query Parameters and String Validations: Add regular expressions](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#add-regular-expressions).
* New Pydantic models use an improved and simplified attribute `model_config` that takes a simple dict instead of an internal class `Config` for their configuration.
* You can read more about it in the docs for [Declare Request Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/).
* The attribute `schema_extra` for the internal class `Config` has been replaced by the key `json_schema_extra` in the new `model_config` dict.
* You can read more about it in the docs for [Declare Request Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/).
* When you install `"fastapi[all]"` it now also includes:
* <a href="https://docs.pydantic.dev/latest/usage/pydantic_settings/" target="_blank"><code>pydantic-settings</code></a> - for settings management.
* <a href="https://docs.pydantic.dev/latest/usage/types/extra_types/extra_types/" target="_blank"><code>pydantic-extra-types</code></a> - for extra types to be used with Pydantic.
* Now Pydantic Settings is an additional optional package (included in `"fastapi[all]"`). To use settings you should now import `from pydantic_settings import BaseSettings` instead of importing from `pydantic` directly.
* You can read more about it in the docs for [Settings and Environment Variables](https://fastapi.tiangolo.com/advanced/settings/).

* PR [9816](https://github.com/tiangolo/fastapi/pull/9816) by [tiangolo](https://github.com/tiangolo), included all the work done (in multiple PRs) on the beta branch (`main-pv2`).

0.100.0beta3

Install with:

shell
pip install --pre --upgrade fastapi pydantic


Features

✨ Beta support for Pydantic version 2 and OpenAPI 3.1.0 ✨

This is probably the **last beta before the final release**, probably in one or two days. So, please, test it out! 🤓 🚀 (before it's too late 😅).

---

> The same details as in the previous beta releases below.

This has many features:

* Improved correctness in corner cases
* Safer types
* Better performance and less energy consumption
* Better extensibility
* etc.

Check out the Pydantic migration guide: https://docs.pydantic.dev/dev-v2/migration/

**This version of FastAPI still supports Pydantic v1**.

This means that you can install the new Pydantic v2, and if something fails, you can install Pydantic v1 while you fix any problems you might have, but having the latest FastAPI.

The focus of this release is compatibility with Pydantic v1 and v2, to make sure your current apps keep working. Later there will be more focus on refactors and code improvements, and then performance improvements. Although you will probably get nice performance improvements already.

There are tests for both Pydantic v1 and v2, and test coverage is kept at 100%.

You will probably still want to **test this version** in your code even if you don't plan to migrate to Pydantic v2 yet, to ensure that the changes of FastAPI don't break your app in any way.

If you install the beta, please let me know if everything is working or if you are having issues in this discussion: https://github.com/tiangolo/fastapi/discussions/9709

Page 4 of 31

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.