FastAPI has published 0.156.2, a small patch release that addresses a single bug in how request parameters are inferred from Pydantic models. The fix, authored by @tiangolo in PR #16553, ensures that Pydantic field metadata is preserved when FastAPI builds request parameters automatically rather than from explicit declarations in the endpoint signature.
This matters because FastAPI leans heavily on Pydantic metadata — things attached to a field such as constraints, descriptions, aliases, and validation rules — to generate parameter handling and OpenAPI schema output. When parameters are inferred from a model instead of being written out directly, that metadata previously could be lost, leaving the resulting request parsing and generated docs out of sync with the model definition.
The concrete changes in this release:
- Fixed a bug where Pydantic field metadata was dropped for inferred request parameters, so constraint and annotation data now carries through correctly.
- Landed the fix via PR
#16553by @tiangolo. - Released as a patch version,
0.156.2, with no new features or breaking changes reported.
For developers, this is a low-risk upgrade that mainly affects applications relying on implicit parameter inference — for example, endpoints where FastAPI derives query or path parameters from Pydantic models rather than explicit Query or Path declarations. If your project uses field-level metadata such as validation constraints or descriptive annotations, upgrading to 0.156.2 should make behavior and generated OpenAPI documentation more consistent with your model definitions. As a patch release, it can typically be adopted with a simple dependency bump, though running your test suite is still recommended to confirm schema and validation output match expectations.
Source: https://github.com/fastapi/fastapi/releases/tag/0.156.2