Skip to main content

validate_schema_org

Function validate_schema_org 

Source
pub fn validate_schema_org(value: &Value) -> Vec<SchemaOrgError>
Expand description

Validates an ISO 20022 JSON-LD blob against the Schema.org subset.

Checks (per @type):

  • @context is present and references schema.org.
  • BankAccount: no hard required fields, but at least one identifier (identifier / iso20022:iban / iso20022:bic) must be set so search engines have something to dedupe against.
  • MoneyTransfer: requires amount of shape MonetaryAmount.
  • BankOrCreditUnion: requires name.
  • FinancialProduct: requires name.
  • PaymentService: requires the namespaced iso20022:instrumentType.

This is a deliberately small subset of the Schema.org vocabulary — only the fields that affect downstream rich-result indexing.

§Examples

use ssg::seo::jsonld::iso20022::{BankAccount, validate_schema_org};
let v = BankAccount {
    iban: Some("GB29NWBK60161331926819".into()),
    ..BankAccount::default()
}.to_jsonld();
assert!(validate_schema_org(&v).is_empty());