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 ID | Module | Description |
|---|---|---|
IBAN_CHECK | iban | ISO 13616 IBAN format + mod-97 check |
BIC_CHECK | bic | ISO 9362 BIC/SWIFT code format |
CURRENCY_CHECK | currency | ISO 4217 currency code |
COUNTRY_CHECK | country | ISO 3166-1 alpha-2 country code |
LEI_CHECK | lei | ISO 17442 LEI format + mod-97 check |
AMOUNT_FORMAT | amount | ISO 20022 decimal amount format |
DATETIME_CHECK | datetime | ISO 8601 datetime (ISO 20022 subset) |
DATE_CHECK | datetime | ISO 8601 date (ISO 20022 subset) |
MIN_LENGTH | length | Minimum string length (XSD minLength) |
MAX_LENGTH | length | Maximum string length (XSD maxLength) |
LENGTH_RANGE | length | Combined min/max range |
* (custom) | pattern | Regex 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/maxLengthfacets. - pattern
- Regex pattern validation rule derived from XSD
patternfacets.
Structs§
- Rule
Registry - A registry of named validation rules.
Traits§
- Rule
- A validation rule that can be applied to a string value at a given path.