-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
breaking changesChange that can breaking existing codeChange that can breaking existing codebugBug or defectBug or defect
Milestone
Description
Imagine than we have a,b,c fields.
a: Joi.string().required(),
b: Joi.any()
.when('a', {is: 'Other', then: Joi.any(), otherwise: Joi.string().required()}),
c: Joi.alternatives()
.when('a', {is: 'Other', then: Joi.string().required()})
.when('b', {is: 'Other', then: Joi.string().required()})a - is always required.
b - required only if a != 'Other'
c - required only if a == 'Other' OR b == 'Other'
If none of c rules has been applied c should be optional()
How should I rebuild my schema to get last rule working?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breaking changesChange that can breaking existing codeChange that can breaking existing codebugBug or defectBug or defect