$ the-wire · showcase
FastAPI 0.160.0 widens the blast radius of parameter model extras
By RepoJournal · Filed · About FastAPI & Pydantic · Composed from the cited sources · methodology
FastAPI 0.160.0 makes a parameter model's extra configuration govern every field submitted in the same parameter location, so models that were quietly ignoring or allowing sibling fields will now reject or capture them.
0.160.0 fastapi/fastapi
by github-actions[bot]
Query, header, cookie, and form models now apply their extra setting to all submitted fields in that parameter location, including fields declared in other models, as individual parameters, or in dependencies, which were previously excluded. Under extra="forbid" a field declared by another parameter is now rejected, and under extra="allow" it lands in the model's extras: a request that validate...
✨ Add support for combining unions of form models fastapi/fastapi
FastAPI now supports combining unions of form models, extending the union handling that previously worked for non-form parameters to multipart and urlencoded bodies. Pull request 16596 ships alongside a fix for OpenAPI schemas on standalone nullable form unions, so the generated spec stops describing those shapes incorrectly.
Fix forward annotations evaluation and type variables substitution when rebuilding parametrized generic models pydantic/pydantic
Pydantic reworked forward annotation evaluation and TypeVar substitution when rebuilding parametrized generic models, fixing two issues with a patch that its author describes as an alternative to an earlier attempt that "doesn't introduce regressions". If you rebuild generic models at runtime with model_rebuild, generic subclasses containing string annotations are the case to re-test.
Fix pickling of `PydanticCustomError` and `ValidationError`s containing custom errors pydantic/pydantic
PydanticCustomError and ValidationError instances that carry custom errors now survive pickling, which matters when validation failures cross a process boundary through multiprocessing, job queues, or cached results. Previously those errors could not be reconstructed on the other side.
Do not extract attribute docstrings from nested classes and functions pydantic/pydantic
The quiet tail: Pydantic stops extracting attribute docstrings from nested classes and functions, and documentation gains notes on datetime support for mocking the current time. A development dependency bump lands with no library behavior attached.
Action items