Skip to content

Conversation

@jb2170
Copy link

@jb2170 jb2170 commented Dec 19, 2024

Closes #872

I don't think any fields other than StringField use the Length validator, so there's no need for an extra elif not field.data: length = 0 line to apply to falsey values: Truthy data likewise would need to implement the len operator in the pre-existing implementation which only string data does. So everything is good.

I've included three stress-test / edge-case scenarios that make the distinction between None and '' clear. The pre-existing implementation fails these tests, and with this PR they pass.

@jb2170
Copy link
Author

jb2170 commented Apr 4, 2025

Closed due to breaking changes: forking off instead. See issue comment.

@jb2170 jb2170 closed this Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Length Validator Broken when min=0

1 participant