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
I've found some unexpected (to me) behaviour in WTForms-JSON where an empty string in an optional string field with a minimum length did not result in a validation error nor exclusion of the field from patch_data. I've written a small test script, here is the output I'm getting from it:
Length validation doesn't happen with the second test case, but it also isn't removed from patch_data like in the first. Potato intuitively should only ever be "maximum" or not present, but both an empty string and None are accepted as None.
The text was updated successfully, but these errors were encountered:
I've tried to debug the problem, it looks like the validation chain is stopped because the Optional validator treats the empty string as the field not being present, but patch_data() still tries to read the field's data value which is set to None.
I've found some unexpected (to me) behaviour in WTForms-JSON where an empty string in an optional string field with a minimum length did not result in a validation error nor exclusion of the field from patch_data. I've written a small test script, here is the output I'm getting from it:
Length validation doesn't happen with the second test case, but it also isn't removed from patch_data like in the first. Potato intuitively should only ever be "maximum" or not present, but both an empty string and None are accepted as None.
The text was updated successfully, but these errors were encountered: