Do we still need to register validators? #1055
Replies: 1 comment 1 reply
-
This is the most convincing thing here. I think it's a risk in itself - validator functions are the easiest way to write validators, but you're correct in that they're an antipattern and not super easy to roll up.
This is a little concerning as we think of branching to different languages. Since we're keeping an ID, I guess this adds to the list of impls we need to make case-by-case for each language?
ID should def not be dropped from the JSON schema def of a Validator. I like this train of thought. Now that we've moved totally to hub, I also think we can update how we think about validator references in RAIL. |
Beta Was this translation helpful? Give feedback.
-
Currently, all validators, both from the hub and local custom validators, must be registered using the
register_validator
decorator. This decorator does a few things:Of these three actions:
Validator.__subclasses__()
.If we were to remove the current requirement of decorating validators with
register_validator
, I foresee the following Pros and Cons. Please add other Pros and Cons you see in the comments.Pros:
class MyValidator(Validator):
and then make their existing function thevalidate
method.Cons:
Caveats:
Beta Was this translation helpful? Give feedback.
All reactions