Skip to content

Proposal: Support validator chaining #1266

@mxmauro

Description

@mxmauro
  • [ X ] I have looked at the documentation here first?
  • [ X ] I have looked at the examples provided that may showcase my question here?

Package version:

v10

Enhancement:

Current implementation does not allow to augment predefined validators.

Let's say someone define a custom type and want to add support for isEq, isNe, etc., If he/she calls RegisterValidation, the existing validator will be overriden completely and existing functionality for them must be written again.

Proposal.

To avoid the library to keep a chain of validators and break compatibility adding a new return value that indicates if the callback handled the validator or the library must call the next one in the chain, I simply propose adding a GetRegisterValidation routine so the developer can manage chaining.

If the idea is accepted, I can create a PR.

Regards,
Mauro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions