Function validateWithError

  • Same functionality as the yup validate function, but throws a BadRequestHttpError if there is an error.

    Type Parameters

    • T extends BaseObjectSchema

    Parameters

    • schema: T
    • data: unknown
    • Optionaloptions: ValidateOptions<AnyObject>

    Returns Promise<T["__outputType"]>