✨ Add `model_fields_optional` to convert inherited fields to Optional by Krishnachaitanyakc · Pull Request #1830 · fastapi/sqlmodel

and others added 3 commits

March 24, 2026 23:18
Add support for `model_fields_optional="all"` configuration that makes
all inherited fields Optional with a default of None. This enables the
common pattern of creating "update" models where all fields are optional,
reducing boilerplate when building CRUD APIs.

Fixes fastapi#64
…nting

- Use `copy.copy()` fallback for FieldInfo when `_copy()` is unavailable
  (added in pydantic 2.12.0, but project supports >=2.11.0)
- Replace `Union[X, None]` with `X | None` to satisfy ruff UP007/UP045
- Apply ruff formatting fixes