|
# override the default output from pydantic by calling `to_dict()` of email |
|
if self.email: |
|
_dict['email'] = self.email.to_dict() |
This if checks whether self.email is None, but it does not handle the case where self.email is a UserServiceSetHumanEmail(mail=None).
As a result, the serialization produces email: {} in the request body, and the Zitadel API responds with a 400 error because it expects email to be a valid string between 1 and 200 characters, even though it is null and should remain unchanged.