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 data
[orm] [bug] Fixed regression caused by issue #11814 which broke support for
certain flavors of PEP 593Annotated in the type_annotation_map when
builtin types such as list, dict were used without an element type.
While this is an incomplete style of typing, these types nonetheless
previously would be located in the type_annotation_map correctly.
[sqlite] [bug] Fixed regression in SQLite reflection caused by #11677 which
interfered with reflection for CHECK constraints that were followed
by other kinds of constraints within the same table definition. Pull
request courtesy Harutaka Kawamura.
[flake8-pyi] Respect pep8_naming.classmethod-decorators settings when determining if a method is a classmethod in custom-type-var-return-type (PYI019) (#13162)
[flake8-pyi] Teach various rules that annotations might be stringized (#12951)
[pylint] Avoid no-self-use for attrs-style validators (#13166)
[pylint] Recurse into subscript subexpressions when searching for list/dict lookups (PLR1733, PLR1736) (#13186)
[pyupgrade] Detect aiofiles.open calls in UP015 (#13173)
[pyupgrade] Mark sys.version_info[0] < 3 and similar comparisons as outdated (UP036) (#13175)
[flake8-pyi] Respect pep8_naming.classmethod-decorators settings when determining if a method is a classmethod in custom-type-var-return-type (PYI019) (#13162)
[flake8-pyi] Teach various rules that annotations might be stringized (#12951)
[pylint] Avoid no-self-use for attrs-style validators (#13166)
[pylint] Recurse into subscript subexpressions when searching for list/dict lookups (PLR1733, PLR1736) (#13186)
[pyupgrade] Detect aiofiles.open calls in UP015 (#13173)
[pyupgrade] Mark sys.version_info[0] < 3 and similar comparisons as outdated (UP036) (#13175)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the all group in /ibis-server with 4 updates: fastapi, pydantic, sqlalchemy and ruff.
Updates
fastapi
from 0.112.2 to 0.114.0Release notes
Sourced from fastapi's releases.
... (truncated)
Commits
bde12fa
🔖 Release version 0.114.074842f0
📝 Update release notese68d8c6
📝 Update release notes4ff22a0
📝 Update docs, Form Models section title, to match config name (#12152)a11e392
📝 Update release notes4633b1b
✨ Add support for forbidding extra form fields with Pydantic models (#12134)1b06b53
📝 Update release notesc411b81
✅ Update internal tests for latest Pydantic, including CI tweaks to install t...d86f660
🔖 Release version 0.113.0179f838
📝 Update release notesUpdates
pydantic
from 2.8.2 to 2.9.1Release notes
Sourced from pydantic's releases.
... (truncated)
Changelog
Sourced from pydantic's changelog.
... (truncated)
Commits
ecc5275
bump2c61bfd
Fix evaluation of stringified annotations during namespace inspection (#10347)3d364cb
Use correct types namespace when building namedtuple core schemas (#10337)2746ccb
FixIncEx
type alias definition (#10339)b32d410
Turntzdata
install requirement into optionaltimezone
dependency (#10331)7d857eb
Fixingannotated-types
bound (#10327)07cbe50
FixPredicate
issue inv2.9.0
(#10321)ed92d0a
Prep for v2.9 release (#10311)eecde7b
Fix lifecycle docs formatting (#10309)447879b
Add schema generation benchmarks for models with custom serializers (#10290)Updates
sqlalchemy
from 2.0.33 to 2.0.34Release notes
Sourced from sqlalchemy's releases.
Commits
Updates
ruff
from 0.6.3 to 0.6.4Release notes
Sourced from ruff's releases.
... (truncated)
Changelog
Sourced from ruff's changelog.
Commits
65cc6ec
Bump version to 0.6.4 (#13253)66fe226
[red-knot] fix lookup of nonlocal names in deferred annotations (#13236)e965f9c
[red-knot] InferUnknown
for the loop var inasync for
loops (#13243)0512428
[red-knot] Emit a diagnostic if the value of a starred expression or a `yield...46a4573
[red-knot] Add type inference for basicfor
loops (#13195)5728909
Make mypy pass on black inknot_benchmark
(#13235)9d1bd7a
[pylint] removed dunder methods in Python 3 (PLW3201) (#13194)e37bde4
[ruff] implement useless if-else (RUF034) (#13218)862bd0c
[red-knot] Add debug assert to check for duplicate definitions (#13214)e1e9143
[red-knot] Handle multiple comprehension targets (#13213)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show