I believe that the verification logic for validator modules is missing a case for validators that use validate/3 instead of validate/2.
Technically, how I perceive the logic to be working is:
validate/3 is called at runtime
use Vex.Validator defines a default validate/3 that delegates to validate/2, discarding the context attribute
- When looking up validators by name (done in
Vex.validator/1), Vex.Validator.Sources encodes what is considered a complete validator module: exporting validate/2
However, this verification assumes that validate/3 is the not overridden and the default implementation delegates to validate/2, otherwise it would be perfectly reasonable to not have validate/2 and instead just defining validate/3
I believe that the verification logic for validator modules is missing a case for validators that use
validate/3instead ofvalidate/2.Technically, how I perceive the logic to be working is:
validate/3is called at runtimeuse Vex.Validatordefines a defaultvalidate/3that delegates tovalidate/2, discarding thecontextattributeVex.validator/1),Vex.Validator.Sourcesencodes what is considered a complete validator module: exportingvalidate/2However, this verification assumes that
validate/3is the not overridden and the default implementation delegates tovalidate/2, otherwise it would be perfectly reasonable to not havevalidate/2and instead just definingvalidate/3