Update dependency fastapi to v0.115.2
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
fastapi (changelog) | dependencies | minor |
0.114.0 -> 0.115.2
|
Release Notes
fastapi/fastapi (fastapi)
v0.115.2
Upgrades
-
⬆ ️ Upgrade Starlette to>=0.37.2,<0.41.0
. MR #12431 by @tiangolo.
v0.115.1
Fixes
-
🐛 Fix openapi generation with responses kwarg. MR #10895 by @flxdot. -
🐛 RemoveRequired
shadowing from fastapi using Pydantic v2. MR #12197 by @pachewise.
Refactors
-
♻ ️ Update type annotations for improvedpython-multipart
. MR #12407 by @tiangolo.
Docs
-
✨ Add new tutorial for SQL databases with SQLModel. MR #12285 by @tiangolo. -
📝 Add External Link: How to profile a FastAPI asynchronous request. MR #12389 by @brouberol. -
🔧 Removebase_path
formdx_include
Markdown extension in MkDocs. MR #12391 by @tiangolo. -
📝 Update link to Swagger UI configuration docs. MR #12264 by @makisukurisu. -
📝 Adding links for Playwright and Vite indocs/project-generation.md
. MR #12274 by @kayqueGovetri. -
📝 Fix small typos in the documentation. MR #12213 by @svlandeg.
Translations
-
🌐 Add Portuguese translation fordocs/pt/docs/tutorial/cookie-param-models.md
. MR #12298 by @ceb10n. -
🌐 Add Portuguese translation fordocs/pt/docs/how-to/graphql.md
. MR #12215 by @AnandaCampelo. -
🌐 Add Portuguese translation fordocs/pt/docs/advanced/security/oauth2-scopes.md
. MR #12263 by @ceb10n. -
🌐 Add Portuguese translation fordocs/pt/docs/deployment/concepts.md
. MR #12219 by @marcelomarkus. -
🌐 Add Portuguese translation fordocs/pt/docs/how-to/conditional-openapi.md
. MR #12221 by @marcelomarkus. -
🌐 Add Portuguese translation fordocs/pt/docs/advanced/response-directly.md
. MR #12266 by @Joao-Pedro-P-Holanda. -
🌐 Update Portuguese translation fordocs/pt/docs/tutorial/cookie-params.md
. MR #12297 by @ceb10n. -
🌐 Fix Korean translation fordocs/ko/docs/tutorial/index.md
. MR #12278 by @kkotipy. -
🌐 Update Portuguese translation fordocs/pt/docs/advanced/security/http-basic-auth.md
. MR #12275 by @andersonrocha0. -
🌐 Add Portuguese translation fordocs/pt/docs/deployment/cloud.md
. MR #12217 by @marcelomarkus. -
✏ ️ Fix typo indocs/es/docs/python-types.md
. MR #12235 by @JavierSanchezCastro. -
🌐 Add Dutch translation fordocs/nl/docs/environment-variables.md
. MR #12200 by @maxscheijen. -
🌐 Add Portuguese translation fordocs/pt/docs/deployment/manually.md
. MR #12210 by @JoaoGustavoRogel. -
🌐 Add Portuguese translation fordocs/pt/docs/deployment/server-workers.md
. MR #12220 by @marcelomarkus. -
🌐 Add Portuguese translation fordocs/pt/docs/how-to/configure-swagger-ui.md
. MR #12222 by @marcelomarkus.
Internal
-
⬆ [pre-commit.ci] pre-commit autoupdate. MR #12396 by @pre-commit-ci[bot]. -
🔨 Add script to generate variants of files. MR #12405 by @tiangolo. -
🔧 Add speakeasy-api tosponsors_badge.yml
. MR #12404 by @tiangolo. -
➕ Add docs dependency: markdown-include-variants. MR #12399 by @tiangolo. -
📝 Fix extra mdx-base-path paths. MR #12397 by @tiangolo. -
👷 Tweak labeler to not override custom labels. MR #12398 by @tiangolo. -
👷 Update worfkow deploy-docs-notify URL. MR #12392 by @tiangolo. -
👷 Update Cloudflare GitHub Action. MR #12387 by @tiangolo. -
⬆ Bump pypa/gh-action-pypi-publish from 1.10.1 to 1.10.3. MR #12386 by @dependabot[bot]. -
⬆ Bump mkdocstrings[python] from 0.25.1 to 0.26.1. MR #12371 by @dependabot[bot]. -
⬆ Bump griffe-typingdoc from 0.2.6 to 0.2.7. MR #12370 by @dependabot[bot]. -
⬆ [pre-commit.ci] pre-commit autoupdate. MR #12331 by @pre-commit-ci[bot]. -
🔧 Update sponsors, remove Fine.dev. MR #12271 by @tiangolo. -
⬆ [pre-commit.ci] pre-commit autoupdate. MR #12253 by @pre-commit-ci[bot]. -
✏ ️ Fix docstring typos in http security. MR #12223 by @albertvillanova.
v0.115.0
Highlights
Now you can declare Query
, Header
, and Cookie
parameters with Pydantic models.
Query
Parameter Models
Use Pydantic models for Query
parameters:
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.
Header
Parameter Models
Use Pydantic models for Header
parameters:
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.
Cookie
Parameter Models
Use Pydantic models for Cookie
parameters:
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.
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"}
:
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:
Features
-
✨ Add support for Pydantic models for parameters usingQuery
,Cookie
,Header
. MR #12199 by @tiangolo.
Translations
-
🌐 Add Portuguese translation fordocs/pt/docs/advanced/security/http-basic-auth.md
. MR #12195 by @ceb10n.
Internal
-
⬆ [pre-commit.ci] pre-commit autoupdate. MR #12204 by @pre-commit-ci[bot].
v0.114.2
Fixes
-
🐛 Fix form field regression withalias
. MR #12194 by @Wurstnase.
Translations
-
🌐 Add Portuguese translation fordocs/pt/docs/tutorial/request-form-models.md
. MR #12175 by @ceb10n. -
🌐 Add Chinese translation fordocs/zh/docs/project-generation.md
. MR #12170 by @waketzheng. -
🌐 Add Dutch translation fordocs/nl/docs/python-types.md
. MR #12158 by @maxscheijen.
Internal
-
💡 Add comments with instructions for Playwright screenshot scripts. MR #12193 by @tiangolo. -
➕ Add inline-snapshot for tests. MR #12189 by @tiangolo.
v0.114.1
Refactors
-
⚡ ️ Improve performance in request body parsing with a cache for internal model fields. MR #12184 by @tiangolo.
Docs
-
📝 Remove duplicate line in docs fordocs/en/docs/environment-variables.md
. MR #12169 by @prometek.
Translations
-
🌐 Add Portuguese translation fordocs/pt/docs/virtual-environments.md
. MR #12163 by @marcelomarkus. -
🌐 Add Portuguese translation fordocs/pt/docs/environment-variables.md
. MR #12162 by @marcelomarkus. -
🌐 Add Portuguese translation fordocs/pt/docs/tutorial/testing.md
. MR #12164 by @marcelomarkus. -
🌐 Add Portuguese translation fordocs/pt/docs/tutorial/debugging.md
. MR #12165 by @marcelomarkus. -
🌐 Add Korean translation fordocs/ko/docs/project-generation.md
. MR #12157 by @BORA040126.
Internal
-
⬆ Bump tiangolo/issue-manager from 0.5.0 to 0.5.1. MR #12173 by @dependabot[bot]. -
⬆ [pre-commit.ci] pre-commit autoupdate. MR #12176 by @pre-commit-ci[bot]. -
👷 Updateissue-manager.yml
. MR #12159 by @tiangolo. -
✏ ️ Fix typo infastapi/params.py
. MR #12143 by @surreal30.
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.