architecture.schema.json
152 lines · archify/schemas/architecture.schema.json at a406594
1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "$id": "https://github.com/tt-a1i/archify/schemas/architecture.schema.json",
4 "title": "Archify Architecture Diagram",
5 "type": "object",
6 "additionalProperties": false,
7 "required": ["schema_version", "diagram_type", "meta", "components"],
8 "properties": {
9 "schema_version": { "const": 1 },
10 "diagram_type": { "const": "architecture" },
11 "meta": {
12 "type": "object",
13 "additionalProperties": false,
14 "required": ["title", "output"],
15 "properties": {
16 "title": { "type": "string", "minLength": 1 },
17 "locale": { "$ref": "common.schema.json#/$defs/locale" },
18 "translations": { "$ref": "common.schema.json#/$defs/translations" },
19 "subtitle": { "type": "string" },
20 "output": { "$ref": "common.schema.json#/$defs/portableOutputPath" },
21 "animation": { "$ref": "common.schema.json#/$defs/animation" },
22 "visual_preset": { "$ref": "common.schema.json#/$defs/visualPreset" },
23 "quality_profile": { "$ref": "common.schema.json#/$defs/qualityProfile" },
24 "engineering_profile": { "enum": ["deployment-ownership"] },
25 "repository": { "$ref": "common.schema.json#/$defs/repository" },
26 "views": { "$ref": "common.schema.json#/$defs/guidedViews" },
27 "legend": {
28 "type": "object",
29 "additionalProperties": false,
30 "properties": {
31 "mode": { "$ref": "common.schema.json#/$defs/legendMode" },
32 "entries": {
33 "type": "object",
34 "additionalProperties": false,
35 "properties": {
36 "frontend": { "$ref": "common.schema.json#/$defs/legendEntry" },
37 "backend": { "$ref": "common.schema.json#/$defs/legendEntry" },
38 "database": { "$ref": "common.schema.json#/$defs/legendEntry" },
39 "cloud": { "$ref": "common.schema.json#/$defs/legendEntry" },
40 "security": { "$ref": "common.schema.json#/$defs/legendEntry" },
41 "messagebus": { "$ref": "common.schema.json#/$defs/legendEntry" },
42 "external": { "$ref": "common.schema.json#/$defs/legendEntry" }
43 }
44 }
45 }
46 },
47 "viewBox": {
48 "type": "array",
49 "prefixItems": [
50 { "type": "number", "minimum": 320 },
51 { "type": "number", "minimum": 240 }
52 ],
53 "items": false,
54 "minItems": 2,
55 "maxItems": 2
56 }
57 }
58 },
59 "layout": {
60 "type": "object",
61 "additionalProperties": false,
62 "required": ["mode"],
63 "properties": {
64 "mode": { "enum": ["grid"] },
65 "origin": { "$ref": "common.schema.json#/$defs/point" },
66 "cols": { "type": "integer", "minimum": 1, "maximum": 12 },
67 "gapX": { "type": "number", "minimum": 0 },
68 "gapY": { "type": "number", "minimum": 0 },
69 "cellW": { "type": "number", "minimum": 40 },
70 "cellH": { "type": "number", "minimum": 24 }
71 }
72 },
73 "components": {
74 "type": "array",
75 "minItems": 1,
76 "items": {
77 "type": "object",
78 "additionalProperties": false,
79 "required": ["id", "type", "label"],
80 "properties": {
81 "id": { "$ref": "common.schema.json#/$defs/id" },
82 "type": { "$ref": "common.schema.json#/$defs/componentType" },
83 "label": { "type": "string", "minLength": 1 },
84 "sublabel": { "type": "string" },
85 "tag": { "type": "string" },
86 "icon": { "$ref": "common.schema.json#/$defs/nodeIcon" },
87 "brand": { "$ref": "common.schema.json#/$defs/brandMark" },
88 "sources": { "$ref": "common.schema.json#/$defs/sourceReferences" },
89 "row": { "type": "integer", "minimum": 0 },
90 "col": { "type": "integer", "minimum": 0 },
91 "pos": { "$ref": "common.schema.json#/$defs/point" },
92 "size": {
93 "type": "array",
94 "prefixItems": [
95 { "type": "number", "exclusiveMinimum": 0 },
96 { "type": "number", "exclusiveMinimum": 0 }
97 ],
98 "items": false,
99 "minItems": 2,
100 "maxItems": 2
101 }
102 }
103 }
104 },
105 "boundaries": {
106 "type": "array",
107 "items": {
108 "type": "object",
109 "additionalProperties": false,
110 "required": ["kind", "label", "wraps"],
111 "properties": {
112 "kind": { "enum": ["region", "security-group"] },
113 "label": { "type": "string", "minLength": 1 },
114 "wraps": {
115 "type": "array",
116 "minItems": 1,
117 "items": { "$ref": "common.schema.json#/$defs/id" }
118 },
119 "pad": { "type": "number", "minimum": 0 }
120 }
121 }
122 },
123 "connections": {
124 "type": "array",
125 "items": {
126 "type": "object",
127 "additionalProperties": false,
128 "required": ["from", "to"],
129 "properties": {
130 "id": { "$ref": "common.schema.json#/$defs/id" },
131 "from": { "$ref": "common.schema.json#/$defs/id" },
132 "to": { "$ref": "common.schema.json#/$defs/id" },
133 "label": { "type": "string" },
134 "variant": { "$ref": "common.schema.json#/$defs/variant" },
135 "fromSide": { "$ref": "common.schema.json#/$defs/side" },
136 "toSide": { "$ref": "common.schema.json#/$defs/side" },
137 "route": { "enum": ["auto", "straight", "orthogonal-h", "orthogonal-v"] },
138 "via": {
139 "type": "array",
140 "items": { "$ref": "common.schema.json#/$defs/point" }
141 },
142 "labelAt": { "$ref": "common.schema.json#/$defs/point" },
143 "labelDx": { "type": "number" },
144 "labelDy": { "type": "number" },
145 "labelSegment": { "type": "integer", "minimum": 0 },
146 "width": { "$ref": "common.schema.json#/$defs/relationshipWidth" }
147 }
148 }
149 },
150 "cards": { "$ref": "common.schema.json#/$defs/cards" }
151 }
152}