diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index 8f5e7b7a2a..4ecf403a6f 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -488,7 +488,6 @@ export interface BooleanSchema extends AnySchema { /** * Allows the values provided to truthy and falsy as well as the "true" and "false" default conversion * (when not in strict() mode) to be matched in a case insensitive manner. - * @param enabled */ insensitive(enabled?: boolean): this; } @@ -792,6 +791,11 @@ export interface ObjectSchema extends AnySchema { */ length(limit: number): this; + /** + * Requires the object to be a Joi schema instance. + */ + schema(): this; + /** * Specify validation rules for unknown keys matching a pattern. * diff --git a/types/joi/joi-tests.ts b/types/joi/joi-tests.ts index af85cab0ac..4dbc784756 100644 --- a/types/joi/joi-tests.ts +++ b/types/joi/joi-tests.ts @@ -706,6 +706,8 @@ objSchema = objSchema.nand(str, str); objSchema = objSchema.nand(str, str, str); objSchema = objSchema.nand(strArr); +objSchema = objSchema.schema(); + objSchema = objSchema.or(str); objSchema = objSchema.or(str, str); objSchema = objSchema.or(str, str, str);