{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/swift/json-schema/swift-bban-elements-schema.json",
  "title": "BbanElements",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/swift-bbans-api-openapi.yml#/components/schemas/BbanElements",
  "type": "object",
  "required": [
    "elements"
  ],
  "properties": {
    "elements": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BbanElementCombination"
      }
    }
  },
  "$defs": {
    "BbanElementCombination": {
      "type": "array",
      "minLength": 1,
      "items": {
        "$ref": "#/$defs/IbanElement"
      }
    },
    "IbanElement": {
      "type": "object",
      "required": [
        "field_position",
        "field_name",
        "field_length",
        "is_max_length",
        "is_mandatory"
      ],
      "properties": {
        "field_position": {
          "type": "number",
          "minimum": 1,
          "maximum": 34,
          "description": "1-based position of the element within an IBAN"
        },
        "field_name": {
          "type": "string",
          "pattern": "^[a-z0-9_]{1,64}$",
          "description": "Machine-friendly element identifier"
        },
        "label_en": {
          "$ref": "#/$defs/StringMax255"
        },
        "label_local": {
          "$ref": "#/$defs/StringMax255"
        },
        "field_length": {
          "type": "number",
          "minimum": 1,
          "maximum": 30
        },
        "is_max_length": {
          "type": "boolean",
          "description": "If true, the element can be supplied shorter than how stated by field_length and it is left-padded with zeroes"
        },
        "is_mandatory": {
          "type": "boolean",
          "description": "If false, IBAN constructor can find its value"
        }
      },
      "additionalProperties": false
    },
    "StringMax255": {
      "description": "Generic string definition, from 1 to 255 characters long",
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    }
  }
}