Skill Tracer
Skills › Archify › archify › class.schema.json

class.schema.json

345 lines · archify/schemas/class.schema.json at a406594

1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "$id": "https://github.com/tt-a1i/archify/schemas/class.schema.json",
4 "title": "Archify Class and Interface Diagram",
5 "type": "object",
6 "additionalProperties": false,
7 "required": [
8 "schema_version",
9 "diagram_type",
10 "meta",
11 "types"
12 ],
13 "properties": {
14 "schema_version": {
15 "const": 1
16 },
17 "diagram_type": {
18 "const": "class"
19 },
20 "meta": {
21 "type": "object",
22 "additionalProperties": false,
23 "required": [
24 "title"
25 ],
26 "properties": {
27 "title": {
28 "type": "string",
29 "minLength": 1
30 },
31 "locale": {
32 "$ref": "common.schema.json#/$defs/locale"
33 },
34 "translations": {
35 "$ref": "common.schema.json#/$defs/translations"
36 },
37 "subtitle": {
38 "type": "string"
39 },
40 "output": {
41 "type": "string"
42 },
43 "animation": {
44 "$ref": "common.schema.json#/$defs/animation"
45 },
46 "visual_preset": {
47 "$ref": "common.schema.json#/$defs/visualPreset"
48 },
49 "quality_profile": {
50 "$ref": "common.schema.json#/$defs/qualityProfile"
51 },
52 "repository": {
53 "$ref": "common.schema.json#/$defs/repository"
54 },
55 "views": {
56 "$ref": "common.schema.json#/$defs/guidedViews"
57 },
58 "legend": {
59 "type": "object",
60 "additionalProperties": false,
61 "properties": {
62 "mode": {
63 "$ref": "common.schema.json#/$defs/legendMode"
64 },
65 "entries": {
66 "type": "object",
67 "additionalProperties": false,
68 "properties": {
69 "dependency": {
70 "$ref": "common.schema.json#/$defs/legendEntry"
71 },
72 "association": {
73 "$ref": "common.schema.json#/$defs/legendEntry"
74 },
75 "inheritance": {
76 "$ref": "common.schema.json#/$defs/legendEntry"
77 },
78 "realization": {
79 "$ref": "common.schema.json#/$defs/legendEntry"
80 },
81 "composition": {
82 "$ref": "common.schema.json#/$defs/legendEntry"
83 },
84 "aggregation": {
85 "$ref": "common.schema.json#/$defs/legendEntry"
86 }
87 }
88 }
89 }
90 },
91 "viewBox": {
92 "type": "array",
93 "prefixItems": [
94 {
95 "type": "number",
96 "minimum": 320
97 },
98 {
99 "type": "number",
100 "minimum": 240
101 }
102 ],
103 "items": false,
104 "minItems": 2,
105 "maxItems": 2
106 }
107 }
108 },
109 "layout": {
110 "type": "object",
111 "additionalProperties": false,
112 "required": [
113 "mode"
114 ],
115 "properties": {
116 "mode": {
117 "enum": [
118 "grid"
119 ]
120 },
121 "origin": {
122 "$ref": "common.schema.json#/$defs/point"
123 },
124 "gapX": {
125 "type": "number",
126 "minimum": 0
127 },
128 "gapY": {
129 "type": "number",
130 "minimum": 0
131 },
132 "typeW": {
133 "type": "number",
134 "minimum": 120
135 },
136 "typeMaxW": {
137 "type": "number",
138 "minimum": 160
139 }
140 }
141 },
142 "types": {
143 "type": "array",
144 "minItems": 1,
145 "items": {
146 "type": "object",
147 "additionalProperties": false,
148 "required": [
149 "id",
150 "label",
151 "kind"
152 ],
153 "properties": {
154 "id": {
155 "$ref": "common.schema.json#/$defs/id"
156 },
157 "label": {
158 "type": "string",
159 "minLength": 1
160 },
161 "kind": {
162 "enum": [
163 "class",
164 "abstract",
165 "interface",
166 "enum",
167 "record"
168 ]
169 },
170 "sublabel": {
171 "type": "string"
172 },
173 "row": {
174 "type": "integer",
175 "minimum": 0,
176 "maximum": 12
177 },
178 "col": {
179 "type": "number",
180 "multipleOf": 0.5,
181 "minimum": 0,
182 "maximum": 12,
183 "description": "Grid column. A half step (e.g. 1.5) centres the type between two columns, such as a supertype over two subtypes."
184 },
185 "pos": {
186 "$ref": "common.schema.json#/$defs/point"
187 },
188 "width": {
189 "type": "number",
190 "minimum": 120
191 },
192 "attributes": {
193 "type": "array",
194 "items": {
195 "$ref": "#/$defs/attribute"
196 }
197 },
198 "methods": {
199 "type": "array",
200 "items": {
201 "$ref": "#/$defs/method"
202 }
203 },
204 "sources": {
205 "$ref": "common.schema.json#/$defs/sourceReferences"
206 }
207 }
208 }
209 },
210 "relationships": {
211 "type": "array",
212 "items": {
213 "type": "object",
214 "additionalProperties": false,
215 "required": [
216 "from",
217 "to",
218 "kind"
219 ],
220 "properties": {
221 "id": {
222 "$ref": "common.schema.json#/$defs/id"
223 },
224 "from": {
225 "$ref": "common.schema.json#/$defs/id"
226 },
227 "to": {
228 "$ref": "common.schema.json#/$defs/id"
229 },
230 "kind": {
231 "enum": [
232 "dependency",
233 "association",
234 "inheritance",
235 "realization",
236 "composition",
237 "aggregation"
238 ]
239 },
240 "label": {
241 "type": "string"
242 },
243 "fromSide": {
244 "$ref": "common.schema.json#/$defs/side"
245 },
246 "toSide": {
247 "$ref": "common.schema.json#/$defs/side"
248 },
249 "route": {
250 "enum": [
251 "auto",
252 "straight",
253 "orthogonal-h",
254 "orthogonal-v"
255 ]
256 },
257 "via": {
258 "type": "array",
259 "items": {
260 "$ref": "common.schema.json#/$defs/point"
261 }
262 },
263 "labelAt": {
264 "$ref": "common.schema.json#/$defs/point"
265 },
266 "labelDx": {
267 "type": "number"
268 },
269 "labelDy": {
270 "type": "number"
271 },
272 "labelSegment": {
273 "type": "integer",
274 "minimum": 0
275 }
276 }
277 }
278 },
279 "cards": {
280 "$ref": "common.schema.json#/$defs/cards"
281 }
282 },
283 "$defs": {
284 "visibility": {
285 "enum": [
286 "public",
287 "protected",
288 "package",
289 "private"
290 ]
291 },
292 "attribute": {
293 "type": "object",
294 "additionalProperties": false,
295 "required": [
296 "name"
297 ],
298 "properties": {
299 "name": {
300 "type": "string",
301 "minLength": 1
302 },
303 "type": {
304 "type": "string",
305 "minLength": 1
306 },
307 "visibility": {
308 "$ref": "#/$defs/visibility"
309 },
310 "static": {
311 "type": "boolean"
312 }
313 }
314 },
315 "method": {
316 "type": "object",
317 "additionalProperties": false,
318 "required": [
319 "name"
320 ],
321 "properties": {
322 "name": {
323 "type": "string",
324 "minLength": 1
325 },
326 "parameters": {
327 "type": "string"
328 },
329 "returns": {
330 "type": "string",
331 "minLength": 1
332 },
333 "visibility": {
334 "$ref": "#/$defs/visibility"
335 },
336 "static": {
337 "type": "boolean"
338 },
339 "abstract": {
340 "type": "boolean"
341 }
342 }
343 }
344 }