FastAPI has published 0.161.1, a small patch release focused on a single correctness fix in schema generation. The release corrects how OpenAPI schemas are produced for standalone nullable form unions — form fields whose type is a union that also accepts None, declared without an enclosing model. With this patch, the generated schema properly reflects that the field is optional while retaining the union of allowed types, so the published OpenAPI document matches what the endpoint actually validates.
The concrete changes in this release:
- Fixed OpenAPI schema generation for standalone nullable form unions (PR #16598).
- Corrected the emitted schema so a nullable union in a form parameter is documented as optional rather than misrepresented.
- Released as a patch-only update by @tiangolo, with no new features or breaking changes announced.
The fix matters most to teams whose workflows depend on an accurate OpenAPI document rather than on runtime behavior alone. Clients generated from the schema — TypeScript SDKs, Java or Go bindings, or other tooling — derive optionality and accepted types from the schema. A form union that silently permits None but is documented otherwise can lead generated clients to send unnecessary values or reject valid payloads. Because the change affects only emitted schemas for this specific form-union pattern, upgrading to 0.161.1 should be low risk; run pip install --upgrade fastapi and regenerate committed schema artifacts or any generated clients to pick up the corrected output. Endpoints that use models rather than standalone form unions are unaffected, so most projects can upgrade without any expected behavior change. Anyone who previously worked around the issue by manually widening generated types or post-processing the schema can likely drop that workaround. Review the diff in PR #16598 if you maintain your own schema consumers.
Source: https://github.com/fastapi/fastapi/releases/tag/0.161.1