Closed lee-hyunkyu closed 2 years ago
When creating a Joi schema with modifiers .allow(null).required(), the type of the resulting object is not correctly nullable even if it passes the runtime check
.allow(null).required()
const schema = joi.object({ x: joi.string().allow(null).required() }) const result = joi.attempt({ x: null }, schema) // expected: typeof result = { x: string | null }
Current Behavior
Expected Behavior
When creating a Joi schema with modifiers
.allow(null).required()
, the type of the resulting object is not correctly nullable even if it passes the runtime checkCurrent Behavior
Expected Behavior