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
When using the StringField as part of a new field class the underlying validate will cause the string field to always be required. StringField calls it super.validate which checks the required flag but the StringField validate then goes on to check if the field value is empty and adds an exception if it is without checking if it is required or not.
The text was updated successfully, but these errors were encountered:
Whenever a value is provided for a field, it is validated, not just when marked required. This is to ensure optional fields are still validated through the same validation flow. If the client doesn't want a field to be validated, they should not be specifying the field in the request.
A majority of the time, an empty string is an invalid input. If there is a use case where an empty string should be a valid value, I would prefer to have a field extend StringField and override validate.
When using the StringField as part of a new field class the underlying validate will cause the string field to always be required. StringField calls it super.validate which checks the required flag but the StringField validate then goes on to check if the field value is empty and adds an exception if it is without checking if it is required or not.
The text was updated successfully, but these errors were encountered: