How can I validate an object with unknown keys with Joi? Here is an example of my data
{
'5520': {
name: 'string',
order: 0,
},
'8123': {
name: 'string',
order: 5,
},
'8219': {
name: 'string',
order: 1,
},
'10113': {
name: 'string',
order: 2,
},
'14538': {
name: 'string',
order: 6,
},
'15277': {
name: 'string',
order: 4,
},
'16723': {
name: 'string',
order: 3,
}
I would like to validate each one of those unknown keys to make sure they all contain name, order and a few other properties, they all must have the same properties.
I read their documentation, just can't figure out how to deal with those unknown keys.