FastAPI 0.159.1 Adds Optional Form Unions
FastAPI 0.159.1 adds support for optional unions of Pydantic form models, allowing endpoints to accept absent or variant form payloads with declarative validation. The update strengthens FastAPI’s increasingly flexible form-handling model.
This is a narrow but meaningful ergonomics win for teams building typed, browser-facing APIs.
- –Optional unions better express form payloads that may be omitted or take multiple model shapes.
- –Builds on FastAPI’s recent expansion of Pydantic-powered form support.
- –Preserves annotation-driven validation and OpenAPI generation.
- –Most valuable for authentication, uploads, and multipart workflows; JSON-only APIs gain little.
DISCOVERED
3h ago
2026-10-22
PUBLISHED
18h ago
2026-10-21
RELEVANCE