Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
It would be very handy to be able to validate an attribute against a list of validators.
This way they can be composed easily
Eg :validator: [instanceof(float), max(2), min(0)]
validator: [instanceof(float), max(2), min(0)]
The text was updated successfully, but these errors were encountered:
I was surprised this didn't "just work" when I tried it, honestly.
Sorry, something went wrong.
this is a duplicate of #13. we’re still trying to come up with something really good and lasting. It seems like this road leads to re-implementing a validation framework which seems like a waste of time.
Yes, #13 looks similar. But a accepting a simple list of validators looks cleaner to me
Allow validator to be a list of validators
You’re right, I’ve added it. A bigger solution is coming but this can be achieved w/o external dependencies.
For those that get this via Googling: https://www.attrs.org/en/stable/api.html#attr.ib
tl;dr: passing a list of validators now works (since 17.1.0)
Successfully merging a pull request may close this issue.