Bump fastapi from 0.112.2 to 0.114.0
Bumps fastapi from 0.112.2 to 0.114.0.
Release notes
Sourced from fastapi's releases.
0.114.0
You can restrict form fields to only include those declared in a Pydantic model and forbid any extra field sent in the request using Pydantic's
model_config = {"extra": "forbid"}:from typing import Annotated from fastapi import FastAPI, Form from pydantic import BaseModel app = FastAPI() class FormData(BaseModel): username: str password: str model_config = {"extra": "forbid"} @app.post("/login/") async def login(data: Annotated[FormData, Form()]): return dataRead the new docs: Form Models - Forbid Extra Form Fields.
Features
✨ Add support for forbidding extra form fields with Pydantic models. PR #12134 by@tiangolo.Docs
📝 Update docs, Form Models section title, to match config name. PR #12152 by@tiangolo.Internal
✅ Update internal tests for latest Pydantic, including CI tweaks to install the latest Pydantic. PR #12147 by@tiangolo.0.113.0
Now you can declare form fields with Pydantic models:
from typing import Annotated from fastapi import FastAPI, Form from pydantic import BaseModel app = FastAPI() class FormData(BaseModel): </tr></table>
... (truncated)
Commits
-
bde12fa🔖 Release version 0.114.0 -
74842f0📝 Update release notes -
e68d8c6📝 Update release notes -
4ff22a0📝 Update docs, Form Models section title, to match config name (#12152) -
a11e392📝 Update release notes -
4633b1b✨ Add support for forbidding extra form fields with Pydantic models (#12134) -
1b06b53📝 Update release notes -
c411b81✅ Update internal tests for latest Pydantic, including CI tweaks to install t... -
d86f660🔖 Release version 0.113.0 -
179f838📝 Update release notes - Additional commits viewable in compare view