$ the-wire ยท showcase
Pydantic 2.13.5 fixes GC, smart union counting; SQLModel deprecates min_items
By RepoJournal ยท Filed ยท About FastAPI & Pydantic
Pydantic 2.13.5 patches garbage collection and smart-union field counting while SQLModel aligns Field with Pydantic and starts deprecating min_items.
Pydantic shipped v2.13.5 (2026-08-28) with three fixes: validator reuse works again when plugins are set, missing GC traversal is fixed on some pydantic-core struct fields, and GeneralFieldsSerializer gets the same GC fix [1]. The same release includes a fix that counts successfully validated, explicitly supplied known fields once per input-specific helper in smart unions, correcting a regression where a smaller union member with a before validator could outrank a larger member using the plain JSON path [2]. Two release-infrastructure bumps landed: twine v7.0.0 and pypa/gh-action-pypi-publish to v1.14.2, the former needed because the previous twine rejected the wheel with "Invalid distribution metadata: '2.5' is not a valid metadata version" [3][4]. SQLModel deprecated the min_items and max_items parameters on Field, aligning with Pydantic's direction [5]. The discriminator parameter on Field now accepts pydantic.types.Discriminator (plus str and None), matching Pydantic's type hint, with tests added for a callable discriminator [6]. Docs work includes fixing "Decimals in SQLModel" to reference Field() instead of condecimal() and grammar/typo cleanups [7][8].
Action items
- โ Upgrade to pydantic 2.13.5 to get GC and smart-union fixes pydantic/pydantic [plan]
- โ Watch SQLModel deprecation warnings for min_items/max_items in Field tiangolo/sqlmodel [monitor]
References
- [1] v2.13.5 โ pydantic/pydantic
- [2] Count validated model fields once in smart unions โ pydantic/pydantic
- [3] Bump twine to v7.0.0 โ pydantic/pydantic
- [4] Bump `pypa/gh-action-pypi-publish` action to v1.14.2 โ pydantic/pydantic
- [5] ๐๏ธ Deprecate `min_items` and `max_items` parameters of `Field` (#1731) โ tiangolo/sqlmodel
- [6] ๐ท๏ธ Allow `Discriminator` type for `discriminator` parameter in `Field` โ tiangolo/sqlmodel
- [7] ๐ Fix "Decimals in SQLModel" to reference `Field()` instead of `condecimal()` (#2035) โ tiangolo/sqlmodel
- [8] โ๏ธ Fix grammar and typos in docs (#2058) โ tiangolo/sqlmodel