You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
evan-hitobito
986d0584fd
🐛 Fix `Form()` with an `Optional` Pydantic model silently discarding data
When a form body parameter was annotated as `Optional[SomeModel]`
(i.e. `SomeModel | None`), `is_union_of_base_models()` returned `False`
because `NoneType` is not a `BaseModel` subclass. This forced the field to
be embedded, so the submitted top-level form fields were never collected
into the model and the value silently resolved to the default (`None`),
with no validation error — unlike the equivalent JSON body, which parses
correctly.
Ignore `None` members when checking a union of models so that
`Optional[SomeModel]` (and `SomeModel | OtherModel | None`) keeps being
treated as a top-level model union. An empty form still validates the
required fields (a 422, consistent with an empty JSON `{}` body).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected] >
2 days ago
..
.agents/skills/ fastapi
♻️ Refactor Library Skills, make info easier to find for agents (#15841)
4 weeks ago
_compat
⬆ Bump ty from 0.0.21 to 0.0.34 (#15443)
2 months ago
dependencies
🐛 Fix `Form()` with an `Optional` Pydantic model silently discarding data
2 days ago
middleware
📝 Use `WSGIMiddleware` from `a2wsgi` instead of deprecated `fastapi.middleware.wsgi.WSGIMiddleware` (#14756)
6 months ago
openapi
✨ Add `iter_route_contexts()` for advanced use cases that used to use `router.routes` (e.g. Jupyverse) (#15785)
1 month ago
security
✏️ Fix typo for `client_secret` in OAuth2 form docstrings (#14946)
4 months ago
__init__.py
🔖 Release version 0.139.2 (#16014)
5 days ago
__main__.py
♻️ Add support for `pip install "fastapi[standard]"` with standard dependencies and `python -m fastapi` (#11935)
2 years ago
applications.py
✨ Add support for `app.frontend("/", directory="dist")` and `router.frontend("/", directory="dist")` (#15800)
1 month ago
background.py
🎨 Update internal types for Python 3.10 (#14898)
5 months ago
cli.py
⬆ Bump ty from 0.0.21 to 0.0.34 (#15443)
2 months ago
concurrency.py
♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564)
7 months ago
datastructures.py
👷 Add `ty` to precommit (#15091)
4 months ago
encoders.py
⬆ Bump ty from 0.0.21 to 0.0.34 (#15443)
2 months ago
exception_handlers.py
⬆️ Upgrade Starlette supported version range to >=0.40.0,<0.49.0 (#14077)
10 months ago
exceptions.py
🎨 Update internal types for Python 3.10 (#14898)
5 months ago
logger.py
🔊 Refactor logging (#781)
7 years ago
param_functions.py
👷 Add `ty` to precommit (#15091)
4 months ago
params.py
⬆ Bump ty from 0.0.21 to 0.0.34 (#15443)
2 months ago
py.typed
✨ add py.typed to ship typing information (#209)
7 years ago
requests.py
⬆ Require Pydantic > 1.0 (#1862)
6 years ago
responses.py
⬆ Bump ty from 0.0.21 to 0.0.34 (#15443)
2 months ago
routing.py
🐛 Refactor router route building to make it thread-safe, mainly relevant for tests running in parallel threads (uncommon) (#16013)
5 days ago
sse.py
♻️ Validate Server Sent Event fields to avoid applications from sending broken data (#15588)
2 months ago
staticfiles.py
✨ Improve type annotations, add support for mypy --strict, internally and for external packages (#2547)
6 years ago
templating.py
✨ Improve type annotations, add support for mypy --strict, internally and for external packages (#2547)
6 years ago
testclient.py
✨ Improve type annotations, add support for mypy --strict, internally and for external packages (#2547)
6 years ago
types.py
🎨 Update internal types for Python 3.10 (#14898)
5 months ago
utils.py
🎨 Update internal types for Python 3.10 (#14898)
5 months ago
websockets.py
✨ Export `WebSocketState` in `fastapi.websockets` (#4376)
4 years ago