Answers for "joi nested objects"

0

joi nested objects

const schemaA = Joi.string()
const schemaB = Joi.object({ keyB1: schemaA, keyB2: Joi.number() })
const schemaC = Joi.object({
  keyC1: Joi.string(),
  keyC2: schemaB  
})

Joi.validate({ keyC1: 'joi', keyC2: { keyB1: 'rocks!', keyB2: 3 } }, schemaC)
Posted by: Guest on September-27-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language