Another odd edge case for joi (tested on v13.0.5). When given no explicit keys or patterns Joi.object() will allow any key even when unknown(false) is specified. Examples:
const schema = Joi.object();
Joi.attempt({ extraKey: 'I am not in the schema' }, schema) // no error this is allowed
const schema = Joi.object().unknown(false);
Joi.attempt({ extraKey: 'I am not in the schema' }, schema) // no error this is also allowed
Another odd edge case for joi (tested on v13.0.5). When given no explicit keys or patterns Joi.object() will allow any key even when
unknown(false)
is specified. Examples: