Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New special validator(s): Validator chains #24

Open
binaryDiv opened this issue Nov 10, 2021 · 0 comments
Open

New special validator(s): Validator chains #24

binaryDiv opened this issue Nov 10, 2021 · 0 comments
Labels
new validator Implementation of a new validator class question Further information is requested
Milestone

Comments

@binaryDiv
Copy link
Contributor

binaryDiv commented Nov 10, 2021

Add a special validator that uses multiple validators in a chain to validate data.

Possibly two variations of this (two validator classes or one with a parameter?):

  • Fallback chain: Try to validate with each validator, return data if one validator succeeds, else fallback to the next validator until one succeeds. (Sort of like validator1 OR validator2 OR ... OR validatorN)
  • Filter chain: Pipe the output of each validator as input to the next validator in the chain, return the result of the last validator, fail if any validator fails. (Sort of like unix pipes: validator1 | validator2 | ... | validatorN or like validator1 AND ...).
@binaryDiv binaryDiv added the new validator Implementation of a new validator class label Nov 10, 2021
@binaryDiv binaryDiv added this to the 1.0.0 Release milestone Nov 10, 2021
@binaryDiv binaryDiv changed the title New meta validator: Validator chains New meta validator(s): Validator chains Nov 10, 2021
@binaryDiv binaryDiv changed the title New meta validator(s): Validator chains New special validator(s): Validator chains May 11, 2022
@binaryDiv binaryDiv added the question Further information is requested label May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new validator Implementation of a new validator class question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant