Skip to content

Question: Validate against sub-schema? #807

@cdaringe

Description

@cdaringe

Hello:

I have a schema, but when my user is using a form, I want to validate onkeypress only the particular field they've modified, using the overarching schema that the form already composes.

// purely hypothetical, but 
var schema = { a: joi.string(), b: joi.string() };
onkeypress = function(evt) {
    joi.validate(evt.target.value, schema.a); // where i could extract a's schema rules only
}

is such a feature available?

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvementsupportQuestions, discussions, and general support

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions