Easy way to compose ORed validators #2466
Labels
flag: needs discussion
Issues which needs discussion before implementation.
type: feature
Issues related to new features.
Background
I am validating that a string is either a MongoId or a UUID. I had to implement my own validator for this:
A workaround is also a somewhat complex RegExp, but that doesn't work in all cases where you want to compose different validators.
Proposed solution
Dream scenario would be to to be able to compose different validators, similar to how applyDecorators(...) works. I am thinking of something like this:
Or something like this:
The text was updated successfully, but these errors were encountered: