You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PATCH vs PUT and optional fields vs "required-but-nullable" fields #716
Pydantic has exclude_unset to distinguish the fields that have the default value because unset, from the fields that have the default value intentionally.
In a Pydantic object, all fields are required, in that they must be defined (have a value), even if it's the default one, most often None, and we signify that a field is not required by having a default None. And when "destructuring" it to pass the dump of the values as arguments (of a CRUD), we exclude None values from the dump with exclude_none.
So there's a confusion between the fields we declare unrequired in the endpoints, from the fields we don't want to pass down to CRUDs.
Activity