FastAPI 0.156.7 has been released, and it is a focused bugfix release rather than a feature drop. The single change addresses a subtle but real problem: when validation fails on form or file parameters that rely on AliasChoices, the reported error location could point at the wrong place. For anyone building APIs that accept multipart or form-encoded input with alternative field names, it is worth a quick upgrade.
- Fixes validation error locations for form and file parameters that use AliasChoices, so error payloads now reference the correct field instead of a misleading location. The change lands via PR #16564 by @tiangolo.
The practical impact is in API ergonomics. When a client sends a form submission with a missing or invalid value, FastAPI returns a structured validation error with a loc array describing where the problem is. If a field accepts several aliases through AliasChoices, the framework has to decide which name and position to report. Before this fix, that mapping could produce a location that did not match what the client actually sent, which makes debugging apps harder — frontend developers see an error pointing at a field name they never used, and tooling that maps errors back to form inputs can misbehave.
The fix corrects that mapping specifically for Form and File parameters. If you generate client-side error messages from the loc array, or you build forms driven by FastAPI's validation responses, behaviour should now be more predictable. There is no new API surface to learn and no migration step; the release is a drop-in patch.
Because this touches error reporting rather than request parsing, most applications will behave identically on success paths. The difference only appears when validation fails, which is exactly when clear diagnostics matter most. Upgrading to 0.156.7 is low risk and keeps your error contracts accurate for aliased form fields.
Source: https://github.com/fastapi/fastapi/releases/tag/0.156.7