Interface SchemaProvider

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

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

Properties

Properties

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

Initialize Joi schema

name: string | () => string

Name of the schema that this provider initializes.

schema?: (props: SchemaProps) => ObjectSchema

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