Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/deno_class_validator/src/index.ts>ValidatorConstraintInterface

Decorator-based property validation for classes.
Latest
interface ValidatorConstraintInterface
Re-export
import { type ValidatorConstraintInterface } from "https://deno.land/x/deno_class_validator@v1.0.0/src/index.ts";

Custom validators must implement this interface to provide custom validation logic.

Methods

validate(value: any, validationArguments?: ValidationArguments): Promise<boolean> | boolean

Method to be called to perform custom validation over given value.

optional
defaultMessage(validationArguments?: ValidationArguments): string

Gets default message when validation for this constraint fail.