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
Email and URL fields have built-in "user validators" (stored in each field's validators attribute. User validators are only applied during deserialization, i.e. when calling Schema#load. Schema#dump only validates against field types (e.g. a valid integer is passed to fields.Int).
That said, one could argue that the email format validation defines fields.Email's "type" and that it should be validated on serialization. Perhaps this would make fields.Email and fields.URL more consistent with the behavior of the other fields.
Thanks for the clarification, the related discussions also helped to better understand the reasoning behind this. That being said I do still like the idea of the fields.Email and fields.URL "type" being used for validation on serialization. As pointed out it would make their behavior more consistent with that of other fields. At the very least maybe an addition to the documentation that points out the current behavior?
Email field type validation does not appear to work when using Schema.dump() but works fine for Schema.load(). Working example included below:
The text was updated successfully, but these errors were encountered: