Skip to content

Vex.Validator.Source.check(validator) only verifies validate/2 #47

@jfornoff

Description

@jfornoff

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions