Closed max-arnold closed 2 years ago
There isn't, and we don't plan to provide within this library itself for now.
As a class decorator, I don't think it's doable, unless it's being done in attrs directly.
Second is doable but arguably not very elegant.
Assigning validators to each field is too verbose and repetitive
attrs.field(validator=type_validator())
.Is there a way to validate a whole class?
Or maybe through a class decorator?