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
This is obviously bad because it repeats the length checks and adds a lot of boilerplate. Something like this would be much simpler:
classFoo(Struct):
bar: Annotated[str, Meta(min_length=1, max_length=20, strip_whitespace=True)]
Even without the length checks, having a built in way to strip whitespace would be very useful and cut down on boilerplate. Other than things like passwords and tokens we need to strip whitespace on every single string field on its way in.
The text was updated successfully, but these errors were encountered:
Description
Right now Meta supports
min_length
andmax_length
, but those are mostly meaningless without first stripping out whitespace.Currently, we have to do variations on this all over the place:
This is obviously bad because it repeats the length checks and adds a lot of boilerplate. Something like this would be much simpler:
Even without the length checks, having a built in way to strip whitespace would be very useful and cut down on boilerplate. Other than things like passwords and tokens we need to strip whitespace on every single string field on its way in.
The text was updated successfully, but these errors were encountered: