From ee33487a8d750e4953fea5da89328b25c95aff40 Mon Sep 17 00:00:00 2001 From: Brendon Smith Date: Sat, 5 Oct 2024 14:24:54 -0400 Subject: [PATCH] Update to FastAPI 0.115 This commit will update/upgrade from FastAPI 0.112 to [FastAPI 0.115](https://fastapi.tiangolo.com/release-notes/). FastAPI 0.113, 0.114, and 0.115 are included in the same inboard commit because the updates in each release are all similar. FastAPI 0.113-0.115 enable cookies, form fields, headers, and query parameters to be declared with Pydantic models. Query parameters, for example, have been [supported](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/) for many versions now, but application authors usually had to encode them as "kwargs" (keyword arguments) in every API endpoint function, resulting in code duplication and the need for custom logic. Now that [query parameter models](https://fastapi.tiangolo.com/tutorial/query-param-models/) are supported, models can be declared once and reused multiple times. There are still gaps here - although FastAPI now supports reusing query parameters, it does not provide features for helping API endpoint functions work with those query parameters. Query parameters are often used to set up filter and sort clauses for relational databases. The construction of `SELECT` statements from these query parameters is still left up to application developers. The related package [SQLModel](https://github.com/fastapi/sqlmodel), while it does combine Pydantic and SQLAlchemy models, does not provide features for `SELECT` statement construction at this time either. Other third-party packages like [fastapi-filters](https://github.com/uriyyo/fastapi-filters) may be helpful. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c16d18a..8e0747e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ docs = [ "mkdocs-material>=9,<10", ] fastapi = [ - "fastapi>=0.112,<0.113", + "fastapi>=0.115,<0.116", ] starlette = [ "starlette>=0.37.2,<0.39.0",