IValidationRule

Interface used to implement custom validation rules.

Description

The IValidationRule interface allows you to implement custom validation rules.

Instance methods

validate

Validates a given value against this rule.

public validate(path: string, schema: Schema, value: any, results: ValidationResult[]): void

  • path: string - a dot notation path to the value.
  • schema: Schema - a schema this rule is called from
  • value: any - a value to be validated.
  • results: ValidationResult[] - a list with validation results to add new results.