Interface SchemaProvider

An interface to be implemented by objects that initialize Joi schema objects.

interface SchemaProvider {
    init: ((props: InitSchemaProps) => Promise<AnySchema<any>>);
    name: string | (() => string);
    schema?: ((props: SchemaProps) => ObjectSchema<any>);
}

Properties

Properties

init: ((props: InitSchemaProps) => Promise<AnySchema<any>>)

Initialize Joi schema

name: string | (() => string)

Name of the schema that this provider initializes.

schema?: ((props: SchemaProps) => ObjectSchema<any>)

Create a schema used to validate properties used to initialize a new schema.