Skip to main content

Module iso20022

Module iso20022 

Source
Expand description

ISO 20022 / banking domain JSON-LD types.

Opt-in extension to the crate::seo::JsonLdPlugin that lets fintech / banking / payments authors emit strongly-typed, Schema.org compatible JSON-LD blobs for the five most common financial domain entities. Ports concepts from the ISO 20022 messaging vocabulary into a Schema.org-friendly shape:

All ISO-20022-specific fields are emitted under the iso20022: namespace prefix so that Schema.org-only validators still see a conformant payload.

§Validation

Two validators are bundled:

  • validate_iban — performs MOD-97 checksum verification per ISO 13616.
  • validate_bic — checks the 8/11-character ISO 9362 layout.

Invalid values do NOT fail the build — they emit a log::warn! naming the offending page and the field that didn’t validate.

§Documentation pointer

On first use within a build, log_first_use_pointer emits an info-level log pointing at the canonical docs URL.

§Schema.org base mapping

ISO 20022 type@type
BankAccountBankAccount
PaymentInstrumentPaymentService
FinancialTransactionMoneyTransfer
RegulatedFinancialInstitutionBankOrCreditUnion
FinancialProductFinancialProduct

Structs§

BankAccount
A bank account record. Schema.org base type: BankAccount.
FinancialProduct
A financial product (loan, deposit, derivative). Schema.org base type: FinancialProduct.
FinancialTransaction
A financial transaction. Schema.org base type: MoneyTransfer.
MonetaryAmount
ISO 4217 monetary amount.
PaymentInstrument
A payment instrument (card, transfer, direct debit). Schema.org base type: PaymentService.
RegulatedFinancialInstitution
A regulated financial institution. Schema.org base type: BankOrCreditUnion.
SchemaOrgError
Validation error raised by the bundled Schema.org subset validator.

Enums§

DispatchError
Errors that can occur when interpreting an iso20022: frontmatter block. These do NOT abort the build — they cause the block to be skipped with a warning.
Iso20022Entity
Tagged union dispatched from the iso20022.type frontmatter key.
ValidationOutcome
Result of an ISO 20022 field validation. Errors are warnings, not hard failures — the build continues regardless.

Constants§

DOCS_URL
Canonical docs URL emitted on first use within a build.

Functions§

from_frontmatter
Parses the iso20022: frontmatter block into a typed entity.
log_first_use_pointer
Emits an info-level log pointing at the iso20022 docs URL, exactly once per process. Idempotent.
redact_for_log
Validates an IBAN (ISO 13616) using the MOD-97 checksum.
validate_bic
Validates a BIC (ISO 9362) by length + alphanumeric layout.
validate_iban
crate dependency-free for the ISO validator.
validate_schema_org
Validates an ISO 20022 JSON-LD blob against the Schema.org subset.
warn_invalid_fields
Walks every IBAN/BIC inside an entity and emits log::warn! for anything that fails validation. The page_label is included in the warning so site authors can locate the offending page.