IValidationRule

Interface used to implement custom validation rules.

Description

The IValidationRule interface allows you to implement custom validation rules.

Methods

Validate

Validates a given value against this rule.

Validate(path string, schema ISchema, value any) []*ValidationResult

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