123 lines
3.9 KiB
JSON
123 lines
3.9 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://gitea.lego-cloud.eu/home-v1-skills-code-agent/drawio-main/raw/branch/main/schemas/diagram-ir-v2.schema.json",
|
|
"title": "drawio-main Diagram IR v2",
|
|
"type": "object",
|
|
"required": ["version", "pages"],
|
|
"properties": {
|
|
"version": { "const": 2 },
|
|
"title": { "type": "string" },
|
|
"pages": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": { "$ref": "#/$defs/page" }
|
|
},
|
|
"provenance": { "type": "object" },
|
|
"assets": { "type": "object" },
|
|
"theme": { "type": "string" },
|
|
"properties": { "type": "object" },
|
|
"extensions": { "type": "object" }
|
|
},
|
|
"additionalProperties": false,
|
|
"$defs": {
|
|
"safeId": {
|
|
"type": "string",
|
|
"pattern": "^[^\\s\\\"'<>]+$",
|
|
"not": { "enum": ["0", "1"] }
|
|
},
|
|
"point": {
|
|
"type": "object",
|
|
"required": ["x", "y"],
|
|
"properties": {
|
|
"x": { "type": "number" },
|
|
"y": { "type": "number" }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"geometry": {
|
|
"type": "object",
|
|
"required": ["x", "y", "width", "height"],
|
|
"properties": {
|
|
"x": { "type": "number" },
|
|
"y": { "type": "number" },
|
|
"width": { "type": "number", "exclusiveMinimum": 0 },
|
|
"height": { "type": "number", "exclusiveMinimum": 0 }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"layout": {
|
|
"type": "object",
|
|
"required": ["type"],
|
|
"properties": {
|
|
"type": { "enum": ["linear", "layered", "tree", "grid", "manual"] },
|
|
"direction": { "enum": ["horizontal", "vertical"] },
|
|
"gridSize": { "type": "number", "exclusiveMinimum": 0 },
|
|
"nodeGap": { "type": "number", "exclusiveMinimum": 0 },
|
|
"layerGap": { "type": "number", "exclusiveMinimum": 0 }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"node": {
|
|
"type": "object",
|
|
"required": ["id", "label"],
|
|
"properties": {
|
|
"id": { "$ref": "#/$defs/safeId" },
|
|
"label": { "type": "string", "minLength": 1, "pattern": "\\S" },
|
|
"kind": { "type": "string" },
|
|
"parentId": { "$ref": "#/$defs/safeId" },
|
|
"width": { "type": "number", "exclusiveMinimum": 0 },
|
|
"height": { "type": "number", "exclusiveMinimum": 0 },
|
|
"geometry": { "$ref": "#/$defs/geometry" },
|
|
"style": { "type": "string" },
|
|
"properties": { "type": "object" },
|
|
"provenance": { "type": "object" },
|
|
"extensions": { "type": "object" }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"edge": {
|
|
"type": "object",
|
|
"required": ["id", "source", "target"],
|
|
"properties": {
|
|
"id": { "$ref": "#/$defs/safeId" },
|
|
"source": { "$ref": "#/$defs/safeId" },
|
|
"target": { "$ref": "#/$defs/safeId" },
|
|
"label": { "type": "string" },
|
|
"kind": { "type": "string" },
|
|
"style": { "type": "string" },
|
|
"waypoints": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/point" }
|
|
},
|
|
"properties": { "type": "object" },
|
|
"provenance": { "type": "object" },
|
|
"extensions": { "type": "object" }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"page": {
|
|
"type": "object",
|
|
"required": ["id", "title", "nodes", "edges"],
|
|
"properties": {
|
|
"id": { "$ref": "#/$defs/safeId" },
|
|
"title": { "type": "string", "minLength": 1, "pattern": "\\S" },
|
|
"nodes": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": { "$ref": "#/$defs/node" }
|
|
},
|
|
"edges": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/edge" }
|
|
},
|
|
"layout": { "$ref": "#/$defs/layout" },
|
|
"width": { "type": "number", "exclusiveMinimum": 0 },
|
|
"height": { "type": "number", "exclusiveMinimum": 0 },
|
|
"properties": { "type": "object" },
|
|
"extensions": { "type": "object" }
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
}
|