Validation schema interface
Description
The ISchema interface contains several validation methods.
Methods
Validate
Validates the given value and returns validation results
Validate(value any) []*ValidationResult
- value: any - value to be validated.
- returns: []*ValidationResult - list with validation results
ValidateAndReturnError
Validates the given value and returns a ValidationException if errors were found.
ValidateAndReturnError(correlationId string, value any, strict bool) *errors.ApplicationError
- correlationId: string - (optional) unique transaction id used to trace execution through the call chain.
- value: any - value to be validated.
- strict: bool - if true,warnings will also raise validation exceptions.
- returns: *errors.ApplicationError - validation exception
ValidateAndThrowError
Validates the given value and throws a ValidationException if errors were found.
ValidateAndThrowError(correlationId string, value any, strict bool)
- correlationId: string - (optional) unique transaction id used to trace execution through the call chain.
- value: any - value to be validated.
- strict: bool - if true,warnings will also raise validation exceptions.