FastAPI 0.156.4 has been released as a focused patch that resolves two related bugs in how the framework handles AliasChoices. Both fixes were authored by @tiangolo and target parameter validation paths where aliased input was not being extracted as expected. The release contains no new features and no breaking changes, so upgrading from a recent 0.156.x version should be low risk for most projects.
The two pull requests address distinct extraction paths that share the same underlying alias machinery:
- Fix
AliasChoicesfor named JSON body parameters (PR #16559): a parameter declared with a name and populated from a JSON request body now resolves itsAliasChoicescorrectly, so multiple accepted aliases in an incoming payload map to the right field. - Fix
AliasChoicesextraction for form models (PR #16557): the same alias resolution is corrected for Pydantic models populated from form data, which previously could fail to pick up the aliased value.
Both changes are bug fixes delivered through the standard pull-request flow, authored by the project maintainer, and are available from the published release tag.
For developers, this matters most where clients send inconsistent or legacy field names. AliasChoices exists precisely so an API can accept several spellings of the same field — for example, snake_case from one consumer and camelCase from another — without duplicating endpoint logic. With these fixes, that flexibility now holds consistently across JSON bodies and form submissions, including multipart and URL-encoded forms used by HTML interfaces and file upload endpoints. If your services rely on aliased form models or named body parameters, pinning to [email protected] and running your existing request-validation tests is a sensible verification step.
Source: https://github.com/fastapi/fastapi/releases/tag/0.156.4