Closed gustavopch closed 6 years ago
As the title says, Joi.array() is always thought to be optional when inside an object.
Joi.array()
import * as Joi from 'joi' import 'joi-extract-type' const schema = Joi.object({ channels: Joi.array().items(Joi.string()).required() }) type Schema = Joi.extractType<typeof schema> // Result: // type Schema = { // channels?: string[] | undefined // }
As the title says,
Joi.array()
is always thought to be optional when inside an object.