{
  "title": "ContainerDiagram",
  "type": "object",
  "properties": {
    "type": {
      "const": "ContainerDiagram",
      "description": "Type of the diagram.",
      "title": "Type",
      "type": "string"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional diagram title.",
      "title": "Title"
    },
    "elements": {
      "description": "Top-level elements.",
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/PersonSchema"
          },
          {
            "$ref": "#/$defs/PersonExtSchema"
          },
          {
            "$ref": "#/$defs/SystemSchema"
          },
          {
            "$ref": "#/$defs/SystemExtSchema"
          },
          {
            "$ref": "#/$defs/SystemDbSchema"
          },
          {
            "$ref": "#/$defs/SystemDbExtSchema"
          },
          {
            "$ref": "#/$defs/SystemQueueSchema"
          },
          {
            "$ref": "#/$defs/SystemQueueExtSchema"
          },
          {
            "$ref": "#/$defs/ContainerSchema"
          },
          {
            "$ref": "#/$defs/ContainerExtSchema"
          },
          {
            "$ref": "#/$defs/ContainerDbSchema"
          },
          {
            "$ref": "#/$defs/ContainerDbExtSchema"
          },
          {
            "$ref": "#/$defs/ContainerQueueSchema"
          },
          {
            "$ref": "#/$defs/ContainerQueueExtSchema"
          }
        ]
      },
      "title": "Elements",
      "type": "array"
    },
    "boundaries": {
      "description": "Top-level boundaries.",
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/BoundarySchema"
          },
          {
            "$ref": "#/$defs/EnterpriseBoundarySchema"
          },
          {
            "$ref": "#/$defs/SystemBoundarySchema"
          },
          {
            "$ref": "#/$defs/ContainerBoundarySchema"
          }
        ]
      },
      "title": "Boundaries",
      "type": "array"
    },
    "relationships": {
      "description": "Top-level relationships.",
      "items": {
        "$ref": "#/$defs/RelationshipSchema"
      },
      "title": "Relationships",
      "type": "array"
    }
  },
  "required": [
    "type"
  ],
  "additionalProperties": false,
  "$defs": {
    "BoundarySchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "commerce_platform",
          "boundaries": [],
          "description": "Boundary for the commerce system and its internal components.",
          "elements": [
            {
              "alias": "web_storefront",
              "description": "Frontend for browsing and checkout.",
              "label": "Web Storefront",
              "type": "System"
            },
            {
              "alias": "orders_db",
              "description": "Stores orders and payment state.",
              "label": "Orders DB",
              "type": "SystemDb"
            }
          ],
          "label": "Commerce Platform",
          "properties": {
            "properties": [
              [
                "Owner",
                "Commerce Team"
              ],
              [
                "Environment",
                "Production"
              ]
            ]
          },
          "relationships": [
            {
              "from": "web_storefront",
              "label": "Reads and writes orders",
              "technology": "SQL",
              "to": "orders_db",
              "type": "REL"
            }
          ],
          "type": "Boundary"
        }
      ],
      "properties": {
        "relationships": {
          "description": "Relationships declared inside the boundary.",
          "items": {
            "$ref": "#/$defs/RelationshipSchema"
          },
          "title": "Relationships",
          "type": "array"
        },
        "type": {
          "const": "Boundary",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        },
        "elements": {
          "description": "Elements may be nested arbitrarily.",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/PersonSchema"
              },
              {
                "$ref": "#/$defs/PersonExtSchema"
              },
              {
                "$ref": "#/$defs/SystemSchema"
              },
              {
                "$ref": "#/$defs/SystemExtSchema"
              },
              {
                "$ref": "#/$defs/SystemDbSchema"
              },
              {
                "$ref": "#/$defs/SystemDbExtSchema"
              },
              {
                "$ref": "#/$defs/SystemQueueSchema"
              },
              {
                "$ref": "#/$defs/SystemQueueExtSchema"
              },
              {
                "$ref": "#/$defs/ContainerSchema"
              },
              {
                "$ref": "#/$defs/ContainerExtSchema"
              },
              {
                "$ref": "#/$defs/ContainerDbSchema"
              },
              {
                "$ref": "#/$defs/ContainerDbExtSchema"
              },
              {
                "$ref": "#/$defs/ContainerQueueSchema"
              },
              {
                "$ref": "#/$defs/ContainerQueueExtSchema"
              }
            ]
          },
          "title": "Elements",
          "type": "array"
        },
        "boundaries": {
          "description": "Boundaries may be nested arbitrarily.",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/BoundarySchema"
              },
              {
                "$ref": "#/$defs/EnterpriseBoundarySchema"
              },
              {
                "$ref": "#/$defs/SystemBoundarySchema"
              },
              {
                "$ref": "#/$defs/ContainerBoundarySchema"
              }
            ]
          },
          "title": "Boundaries",
          "type": "array"
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "Boundary",
      "type": "object"
    },
    "ContainerBoundarySchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "checkout_boundary",
          "boundaries": [],
          "description": "Groups checkout-related containers.",
          "elements": [
            {
              "alias": "checkout_api",
              "description": "Handles cart and checkout operations.",
              "label": "Checkout API",
              "technology": "FastAPI",
              "type": "Container"
            },
            {
              "alias": "checkout_db",
              "description": "Stores carts and checkout sessions.",
              "label": "Checkout DB",
              "technology": "PostgreSQL",
              "type": "ContainerDb"
            }
          ],
          "label": "Checkout Subsystem",
          "properties": {
            "properties": [
              [
                "Owner",
                "Checkout Team"
              ],
              [
                "Domain",
                "Commerce"
              ]
            ]
          },
          "relationships": [
            {
              "from": "checkout_api",
              "label": "Reads and writes",
              "technology": "SQL",
              "to": "checkout_db",
              "type": "REL"
            }
          ],
          "type": "ContainerBoundary"
        }
      ],
      "properties": {
        "relationships": {
          "description": "Relationships declared inside the boundary.",
          "items": {
            "$ref": "#/$defs/RelationshipSchema"
          },
          "title": "Relationships",
          "type": "array"
        },
        "type": {
          "const": "ContainerBoundary",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        },
        "elements": {
          "description": "Elements may be nested arbitrarily.",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/PersonSchema"
              },
              {
                "$ref": "#/$defs/PersonExtSchema"
              },
              {
                "$ref": "#/$defs/SystemSchema"
              },
              {
                "$ref": "#/$defs/SystemExtSchema"
              },
              {
                "$ref": "#/$defs/SystemDbSchema"
              },
              {
                "$ref": "#/$defs/SystemDbExtSchema"
              },
              {
                "$ref": "#/$defs/SystemQueueSchema"
              },
              {
                "$ref": "#/$defs/SystemQueueExtSchema"
              },
              {
                "$ref": "#/$defs/ContainerSchema"
              },
              {
                "$ref": "#/$defs/ContainerExtSchema"
              },
              {
                "$ref": "#/$defs/ContainerDbSchema"
              },
              {
                "$ref": "#/$defs/ContainerDbExtSchema"
              },
              {
                "$ref": "#/$defs/ContainerQueueSchema"
              },
              {
                "$ref": "#/$defs/ContainerQueueExtSchema"
              }
            ]
          },
          "title": "Elements",
          "type": "array"
        },
        "boundaries": {
          "description": "Boundaries may be nested arbitrarily.",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/BoundarySchema"
              },
              {
                "$ref": "#/$defs/EnterpriseBoundarySchema"
              },
              {
                "$ref": "#/$defs/SystemBoundarySchema"
              },
              {
                "$ref": "#/$defs/ContainerBoundarySchema"
              }
            ]
          },
          "title": "Boundaries",
          "type": "array"
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "ContainerBoundary",
      "type": "object"
    },
    "ContainerDbExtSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "fraud_vendor_db",
          "description": "External datastore used to look up fraud signals.",
          "label": "Fraud Vendor Database",
          "properties": {
            "properties": [
              [
                "Provider",
                "FraudCo"
              ],
              [
                "Access",
                "Read-only"
              ]
            ]
          },
          "technology": "Vendor DB",
          "type": "ContainerDbExt"
        }
      ],
      "properties": {
        "technology": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional technology.",
          "title": "Technology"
        },
        "type": {
          "const": "ContainerDbExt",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "ContainerDbExt",
      "type": "object"
    },
    "ContainerDbSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "catalog_db",
          "description": "Stores products, categories, and pricing data.",
          "label": "Catalog Database",
          "properties": {
            "properties": [
              [
                "Engine",
                "PostgreSQL 16"
              ],
              [
                "Replication",
                "Streaming"
              ]
            ]
          },
          "technology": "PostgreSQL",
          "type": "ContainerDb"
        }
      ],
      "properties": {
        "technology": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional technology.",
          "title": "Technology"
        },
        "type": {
          "const": "ContainerDb",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "ContainerDb",
      "type": "object"
    },
    "ContainerExtSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "recommendation_api",
          "description": "External API that returns personalized product recommendations.",
          "label": "Recommendation Engine API",
          "properties": {
            "properties": [
              [
                "SLA",
                "99.9%"
              ],
              [
                "Owner",
                "Partner"
              ]
            ]
          },
          "technology": "REST API",
          "type": "ContainerExt"
        }
      ],
      "properties": {
        "technology": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional technology.",
          "title": "Technology"
        },
        "type": {
          "const": "ContainerExt",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "ContainerExt",
      "type": "object"
    },
    "ContainerQueueExtSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "partner_fulfillment_topic",
          "description": "External topic with fulfillment status updates.",
          "label": "Partner Fulfillment Topic",
          "properties": {
            "properties": [
              [
                "Broker",
                "Managed Kafka"
              ],
              [
                "Format",
                "Avro"
              ]
            ]
          },
          "technology": "Kafka",
          "type": "ContainerQueueExt"
        }
      ],
      "properties": {
        "technology": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional technology.",
          "title": "Technology"
        },
        "type": {
          "const": "ContainerQueueExt",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "ContainerQueueExt",
      "type": "object"
    },
    "ContainerQueueSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "payment_events_queue",
          "description": "Carries asynchronous payment status updates.",
          "label": "Payment Events Queue",
          "properties": {
            "properties": [
              [
                "Durable",
                "true"
              ],
              [
                "DLQ",
                "payment_events_dlq"
              ]
            ]
          },
          "technology": "RabbitMQ",
          "type": "ContainerQueue"
        }
      ],
      "properties": {
        "technology": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional technology.",
          "title": "Technology"
        },
        "type": {
          "const": "ContainerQueue",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "ContainerQueue",
      "type": "object"
    },
    "ContainerSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "backend_api",
          "description": "Main backend API serving web and mobile clients.",
          "label": "Backend API",
          "properties": {
            "properties": [
              [
                "Runtime",
                "Python 3.12"
              ],
              [
                "Team",
                "Platform"
              ]
            ]
          },
          "technology": "Python / FastAPI",
          "type": "Container"
        }
      ],
      "properties": {
        "technology": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional technology.",
          "title": "Technology"
        },
        "type": {
          "const": "Container",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "Container",
      "type": "object"
    },
    "DiagramElementPropertiesSchema": {
      "properties": {
        "show_header": {
          "default": true,
          "description": "Whether to display the header row.",
          "title": "Show Header",
          "type": "boolean"
        },
        "header": {
          "default": [
            "Property",
            "Value"
          ],
          "description": "Header columns.",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "title": "Header",
          "type": "array"
        },
        "properties": {
          "type": "array",
          "items": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "List of rows (each row is a list of string values).",
          "title": "Properties"
        }
      },
      "required": [
        "properties"
      ],
      "title": "DiagramElementPropertiesSchema",
      "type": "object"
    },
    "EnterpriseBoundarySchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "acme",
          "boundaries": [
            {
              "alias": "commerce_domain",
              "boundaries": [],
              "elements": [],
              "label": "Commerce Domain",
              "relationships": [],
              "type": "SystemBoundary"
            }
          ],
          "description": "Enterprise boundary containing internal platforms.",
          "elements": [
            {
              "alias": "customer_portal",
              "description": "Entry point for customers.",
              "label": "Customer Portal",
              "type": "System"
            },
            {
              "alias": "shared_identity",
              "description": "Central authentication service.",
              "label": "Shared Identity",
              "type": "System"
            }
          ],
          "label": "Acme Corp",
          "properties": {
            "properties": [
              [
                "Region",
                "EU"
              ],
              [
                "Department",
                "Digital"
              ]
            ]
          },
          "relationships": [
            {
              "from": "customer_portal",
              "label": "Authenticates via",
              "technology": "OIDC",
              "to": "shared_identity",
              "type": "REL"
            }
          ],
          "type": "EnterpriseBoundary"
        }
      ],
      "properties": {
        "relationships": {
          "description": "Relationships declared inside the boundary.",
          "items": {
            "$ref": "#/$defs/RelationshipSchema"
          },
          "title": "Relationships",
          "type": "array"
        },
        "type": {
          "const": "EnterpriseBoundary",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        },
        "elements": {
          "description": "Elements may be nested arbitrarily.",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/PersonSchema"
              },
              {
                "$ref": "#/$defs/PersonExtSchema"
              },
              {
                "$ref": "#/$defs/SystemSchema"
              },
              {
                "$ref": "#/$defs/SystemExtSchema"
              },
              {
                "$ref": "#/$defs/SystemDbSchema"
              },
              {
                "$ref": "#/$defs/SystemDbExtSchema"
              },
              {
                "$ref": "#/$defs/SystemQueueSchema"
              },
              {
                "$ref": "#/$defs/SystemQueueExtSchema"
              },
              {
                "$ref": "#/$defs/ContainerSchema"
              },
              {
                "$ref": "#/$defs/ContainerExtSchema"
              },
              {
                "$ref": "#/$defs/ContainerDbSchema"
              },
              {
                "$ref": "#/$defs/ContainerDbExtSchema"
              },
              {
                "$ref": "#/$defs/ContainerQueueSchema"
              },
              {
                "$ref": "#/$defs/ContainerQueueExtSchema"
              }
            ]
          },
          "title": "Elements",
          "type": "array"
        },
        "boundaries": {
          "description": "Boundaries may be nested arbitrarily.",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/BoundarySchema"
              },
              {
                "$ref": "#/$defs/EnterpriseBoundarySchema"
              },
              {
                "$ref": "#/$defs/SystemBoundarySchema"
              },
              {
                "$ref": "#/$defs/ContainerBoundarySchema"
              }
            ]
          },
          "title": "Boundaries",
          "type": "array"
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "EnterpriseBoundary",
      "type": "object"
    },
    "PersonExtSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "auditor",
          "description": "External compliance reviewer.",
          "label": "Auditor",
          "properties": {
            "properties": [
              [
                "Organization",
                "Compliance Partner"
              ],
              [
                "Access",
                "Read-only"
              ]
            ]
          },
          "type": "PersonExt"
        }
      ],
      "properties": {
        "type": {
          "const": "PersonExt",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "PersonExt",
      "type": "object"
    },
    "PersonSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "store_manager",
          "description": "Manages product catalog and promotions.",
          "label": "Store Manager",
          "properties": {
            "properties": [
              [
                "Department",
                "Retail Ops"
              ],
              [
                "Role",
                "Manager"
              ]
            ]
          },
          "type": "Person"
        }
      ],
      "properties": {
        "type": {
          "const": "Person",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "Person",
      "type": "object"
    },
    "RelationshipSchema": {
      "additionalProperties": false,
      "properties": {
        "type": {
          "const": "REL",
          "description": "Type of the relationship.",
          "title": "Type",
          "type": "string"
        },
        "from": {
          "description": "The source element alias (or unique label).",
          "minLength": 1,
          "title": "From",
          "type": "string"
        },
        "to": {
          "description": "The destination element alias (or unique label).",
          "minLength": 1,
          "title": "To",
          "type": "string"
        },
        "label": {
          "description": "The label shown on the relationship edge.",
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Additional details about the relationship.",
          "title": "Description"
        },
        "technology": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The technology used in the communication.",
          "title": "Technology"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "from",
        "to",
        "label"
      ],
      "title": "Relationship",
      "type": "object"
    },
    "SystemBoundarySchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "commerce_platform",
          "boundaries": [],
          "description": "Boundary for the commerce system and its internal components.",
          "elements": [
            {
              "alias": "web_storefront",
              "description": "Frontend for browsing and checkout.",
              "label": "Web Storefront",
              "type": "System"
            },
            {
              "alias": "orders_db",
              "description": "Stores orders and payment state.",
              "label": "Orders DB",
              "type": "SystemDb"
            }
          ],
          "label": "Commerce Platform",
          "properties": {
            "properties": [
              [
                "Owner",
                "Commerce Team"
              ],
              [
                "Environment",
                "Production"
              ]
            ]
          },
          "relationships": [
            {
              "from": "web_storefront",
              "label": "Reads and writes orders",
              "technology": "SQL",
              "to": "orders_db",
              "type": "REL"
            }
          ],
          "type": "SystemBoundary"
        }
      ],
      "properties": {
        "relationships": {
          "description": "Relationships declared inside the boundary.",
          "items": {
            "$ref": "#/$defs/RelationshipSchema"
          },
          "title": "Relationships",
          "type": "array"
        },
        "type": {
          "const": "SystemBoundary",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        },
        "elements": {
          "description": "Elements may be nested arbitrarily.",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/PersonSchema"
              },
              {
                "$ref": "#/$defs/PersonExtSchema"
              },
              {
                "$ref": "#/$defs/SystemSchema"
              },
              {
                "$ref": "#/$defs/SystemExtSchema"
              },
              {
                "$ref": "#/$defs/SystemDbSchema"
              },
              {
                "$ref": "#/$defs/SystemDbExtSchema"
              },
              {
                "$ref": "#/$defs/SystemQueueSchema"
              },
              {
                "$ref": "#/$defs/SystemQueueExtSchema"
              },
              {
                "$ref": "#/$defs/ContainerSchema"
              },
              {
                "$ref": "#/$defs/ContainerExtSchema"
              },
              {
                "$ref": "#/$defs/ContainerDbSchema"
              },
              {
                "$ref": "#/$defs/ContainerDbExtSchema"
              },
              {
                "$ref": "#/$defs/ContainerQueueSchema"
              },
              {
                "$ref": "#/$defs/ContainerQueueExtSchema"
              }
            ]
          },
          "title": "Elements",
          "type": "array"
        },
        "boundaries": {
          "description": "Boundaries may be nested arbitrarily.",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/BoundarySchema"
              },
              {
                "$ref": "#/$defs/EnterpriseBoundarySchema"
              },
              {
                "$ref": "#/$defs/SystemBoundarySchema"
              },
              {
                "$ref": "#/$defs/ContainerBoundarySchema"
              }
            ]
          },
          "title": "Boundaries",
          "type": "array"
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "SystemBoundary",
      "type": "object"
    },
    "SystemDbExtSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "credit_bureau_db",
          "description": "External database with risk assessment data.",
          "label": "Credit Bureau DB",
          "properties": {
            "properties": [
              [
                "Provider",
                "RiskCo"
              ],
              [
                "Access",
                "Read-only"
              ]
            ]
          },
          "type": "SystemDbExt"
        }
      ],
      "properties": {
        "type": {
          "const": "SystemDbExt",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "SystemDbExt",
      "type": "object"
    },
    "SystemDbSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "customer_profile_db",
          "description": "Stores customer preferences and account metadata.",
          "label": "Customer Profile DB",
          "properties": {
            "properties": [
              [
                "Engine",
                "PostgreSQL"
              ],
              [
                "Backup",
                "Daily"
              ]
            ]
          },
          "type": "SystemDb"
        }
      ],
      "properties": {
        "type": {
          "const": "SystemDb",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "SystemDb",
      "type": "object"
    },
    "SystemExtSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "shipping_provider",
          "description": "External logistics platform for shipment booking and tracking.",
          "label": "Shipping Provider",
          "properties": {
            "properties": [
              [
                "Protocol",
                "REST"
              ],
              [
                "SLA",
                "99.9%"
              ]
            ]
          },
          "type": "SystemExt"
        }
      ],
      "properties": {
        "type": {
          "const": "SystemExt",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "SystemExt",
      "type": "object"
    },
    "SystemQueueExtSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "partner_events_topic",
          "description": "External event topic carrying delivery status updates.",
          "label": "Partner Events Topic",
          "properties": {
            "properties": [
              [
                "Broker",
                "Kafka"
              ],
              [
                "Format",
                "Avro"
              ]
            ]
          },
          "type": "SystemQueueExt"
        }
      ],
      "properties": {
        "type": {
          "const": "SystemQueueExt",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "SystemQueueExt",
      "type": "object"
    },
    "SystemQueueSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "order_events_stream",
          "description": "Internal stream of order lifecycle events.",
          "label": "Order Events Stream",
          "properties": {
            "properties": [
              [
                "Retention",
                "7 days"
              ],
              [
                "Partitions",
                "12"
              ]
            ]
          },
          "type": "SystemQueue"
        }
      ],
      "properties": {
        "type": {
          "const": "SystemQueue",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "SystemQueue",
      "type": "object"
    },
    "SystemSchema": {
      "additionalProperties": false,
      "examples": [
        {
          "alias": "inventory_service",
          "description": "Tracks stock levels and reservation state.",
          "label": "Inventory Service",
          "properties": {
            "properties": [
              [
                "Language",
                "Python"
              ],
              [
                "Team",
                "Supply Chain"
              ]
            ]
          },
          "type": "System"
        }
      ],
      "properties": {
        "type": {
          "const": "System",
          "description": "Discriminator identifying the element type.",
          "title": "Type",
          "type": "string"
        },
        "label": {
          "description": "Display name for the element.",
          "minLength": 1,
          "title": "Label",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional description text.",
          "title": "Description"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique identifier for the element. If not provided, it is autogenerated from the label.",
          "title": "Alias"
        },
        "properties": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagramElementPropertiesSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional property table metadata."
        }
      },
      "required": [
        "type",
        "label"
      ],
      "title": "System",
      "type": "object"
    }
  }
}
