Skip to content

Commit

Permalink
Update to FastAPI 0.115
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
br3ndonland committed Oct 5, 2024
1 parent df6885d commit ee33487
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ee33487

Please sign in to comment.