Skip to main content

Module rules

Module rules 

Source
Expand description

Validation rule registry and built-in rule implementations.

§Overview

Rules are stateless validators that inspect a string value at a named path and produce zero or more ValidationErrors. They are registered in a RuleRegistry and looked up by ID when validating fields.

§Built-in rules

Rule IDModuleDescription
IBAN_CHECKibanISO 13616 IBAN format + mod-97 check
BIC_CHECKbicISO 9362 BIC/SWIFT code format
CURRENCY_CHECKcurrencyISO 4217 currency code
COUNTRY_CHECKcountryISO 3166-1 alpha-2 country code
LEI_CHECKleiISO 17442 LEI format + mod-97 check
AMOUNT_FORMATamountISO 20022 decimal amount format
DATETIME_CHECKdatetimeISO 8601 datetime (ISO 20022 subset)
DATE_CHECKdatetimeISO 8601 date (ISO 20022 subset)
MIN_LENGTHlengthMinimum string length (XSD minLength)
MAX_LENGTHlengthMaximum string length (XSD maxLength)
LENGTH_RANGElengthCombined min/max range
* (custom)patternRegex pattern (XSD pattern facet)

Modules§

amount
ISO 20022 amount format validation rule.
bic
BIC (Bank Identifier Code) / SWIFT code validation rule.
country
ISO 3166-1 alpha-2 country code validation rule.
currency
ISO 4217 currency code validation rule.
datetime
ISO 8601 date and datetime validation rules for ISO 20022 messages.
iban
IBAN (International Bank Account Number) validation rule.
lei
LEI (Legal Entity Identifier) validation rule.
length
String length validation rules derived from XSD minLength / maxLength facets.
pattern
Regex pattern validation rule derived from XSD pattern facets.

Structs§

RuleRegistry
A registry of named validation rules.

Traits§

Rule
A validation rule that can be applied to a string value at a given path.