-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Assume I have objects like this:
{
a: 'key',
b: 'value',
data: [
{ key: 'keyA', value: 1 },
{ key: 'keyB', value: 2 }
]
}{
a: 'anotherKey',
b: 'anotherValue',
data: [
{ anotherKey: 'keyA', anotherValue: 1 },
{ anotherKey: 'keyB', anotherValue: 2 }
]
}Keys of object in array data must specify by key a and b.
I think it would be:
Joi.object({
a: Joi.string().required(),
b: Joi.string().required(),
data: Joi.array()
.items(
Joi.object()
.pattern(Joi.ref('a'), Joi.string().required())
.pattern(Joi.ref('b'), Joi.number().required())
)
.required(),
})Seems like #1382, but different.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugBug or defectBug or defect