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

Multiple custom validator durability #124

Open
Bellver0101 opened this issue Apr 29, 2022 · 0 comments
Open

Multiple custom validator durability #124

Bellver0101 opened this issue Apr 29, 2022 · 0 comments

Comments

@Bellver0101
Copy link

Bellver0101 commented Apr 29, 2022

My schema looks like this.

{
    "url": {
        type: String,
        required: true,
        use: {
            urlIncludesProtocol: function (val, inputCtx, path) {
                return false; // the code stops right here, but I want it keep running until it finishes
            },
            urlIncludesIp: function (val, inputCtx, path) {
                return false; // this,
            },
            urlIncludesPort: function (val, inputCtx, path) {
                return false; // and this.
            },

        }
    }
}

So If there are multiple custom validators in an element, even if one of them fails, I want it to keep validating until it finishes all of its remaining custom validators.

Is there any option for this? or do I have to do some work-around?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant