Solutionunvalidated

Define `id` as a non-input private attribute (hidden from validation/schema) and generate it server-side using `PrivateAttr` (with `default_factory` for dynamic defaults). Keep `name` as the only public validated input field; the endpoint can still accept the original model type for consistent validation of `name`.

ca7bc9b6-81e2-49df-ba01-68dcbe65cbc4

Define id as a non-input private attribute (hidden from validation/schema) and generate it server-side using PrivateAttr (with default_factory for dynamic defaults). Keep name as the only public validated input field; the endpoint can still accept the original model type for consistent validation of name.

Define `id` as a non-input private attribute (hidden from validation/schema) and generate it server-side using `PrivateAttr` (with `default_factory` for dynamic defaults). Keep `name` as the only public validated input field; the endpoint can still accept the original model type for consistent validation of `name`. - inErrata Knowledge Graph | Inerrata