-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharch-schema.json
More file actions
306 lines (306 loc) · 11.3 KB
/
arch-schema.json
File metadata and controls
306 lines (306 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://club-api/arch-schema.json",
"title": "Architecture Schema",
"description": "Schema for validating the architecture definition of a DDD-based application.",
"type": "object",
"required": ["contexts", "meta"],
"properties": {
"contexts": {
"type": "array",
"description": "List of bounded contexts in the application.",
"items": {
"$ref": "#/$defs/context"
}
},
"meta": {
"$ref": "#/$defs/meta"
}
},
"$defs": {
"context": {
"type": "object",
"description": "A bounded context containing one or more modules.",
"required": ["name", "modules"],
"properties": {
"name": {
"type": "string",
"description": "The name of the bounded context."
},
"modules": {
"type": "array",
"description": "List of modules within the bounded context.",
"items": {
"$ref": "#/$defs/module"
}
}
},
"additionalProperties": false
},
"module": {
"type": "object",
"description": "A module within a bounded context.",
"required": ["name"],
"properties": {
"name": {
"type": "string",
"description": "The name of the module."
},
"description": {
"type": "string",
"description": "A description of the module's purpose."
},
"commands": {
"type": "array",
"description": "List of commands in the module.",
"items": {
"$ref": "#/$defs/command"
}
},
"queries": {
"type": "array",
"description": "List of queries in the module.",
"items": {
"$ref": "#/$defs/query"
}
},
"domainEvents": {
"type": "array",
"description": "List of domain events in the module.",
"items": {
"$ref": "#/$defs/domainEvent"
}
},
"eventSubscribers": {
"type": "array",
"description": "List of event subscribers in the module.",
"items": {
"$ref": "#/$defs/eventSubscriber"
}
},
"externalCalls": {
"type": "array",
"description": "List of external calls to other modules/contexts.",
"items": {
"$ref": "#/$defs/externalCall"
}
}
},
"additionalProperties": false
},
"command": {
"type": "object",
"description": "A command representing a write operation.",
"required": ["name", "class", "input", "output"],
"properties": {
"name": {
"type": "string",
"description": "The name of the command."
},
"class": {
"type": "string",
"description": "The fully qualified class name (FQCN) of the command."
},
"description": {
"type": "string",
"description": "A description of what the command does."
},
"input": {
"type": "array",
"description": "Constructor parameters of the command.",
"items": {
"$ref": "#/$defs/parameter"
}
},
"output": {
"$ref": "#/$defs/outputType"
}
},
"additionalProperties": false
},
"query": {
"type": "object",
"description": "A query representing a read operation.",
"required": ["name", "class", "input", "output"],
"properties": {
"name": {
"type": "string",
"description": "The name of the query."
},
"class": {
"type": "string",
"description": "The fully qualified class name (FQCN) of the query."
},
"description": {
"type": "string",
"description": "A description of what the query returns."
},
"input": {
"type": "array",
"description": "Constructor parameters of the query.",
"items": {
"$ref": "#/$defs/parameter"
}
},
"output": {
"$ref": "#/$defs/outputType"
}
},
"additionalProperties": false
},
"parameter": {
"type": "object",
"description": "A constructor parameter with name, type, and FQCN.",
"required": ["name", "type"],
"properties": {
"name": {
"type": "string",
"description": "The parameter name."
},
"type": {
"type": "string",
"description": "The type name (short form)."
},
"class": {
"type": "string",
"description": "The fully qualified class name (FQCN) of the type."
},
"description": {
"type": "string",
"description": "A description of the parameter."
}
},
"additionalProperties": false
},
"outputType": {
"type": "object",
"description": "The output type of a command or query.",
"required": ["type"],
"properties": {
"type": {
"type": "string",
"description": "The type name (short form)."
},
"class": {
"type": "string",
"description": "The fully qualified class name (FQCN) of the type."
}
},
"additionalProperties": false
},
"domainEvent": {
"type": "object",
"description": "A domain event emitted by an aggregate.",
"required": ["name", "class", "properties"],
"properties": {
"name": {
"type": "string",
"description": "The name of the domain event."
},
"class": {
"type": "string",
"description": "The fully qualified class name (FQCN) of the event."
},
"description": {
"type": "string",
"description": "A description of when the event is emitted."
},
"properties": {
"type": "array",
"description": "Properties carried by the event.",
"items": {
"$ref": "#/$defs/parameter"
}
}
},
"additionalProperties": false
},
"eventSubscriber": {
"type": "object",
"description": "An event subscriber that reacts to domain events.",
"required": ["name", "class", "event", "eventClass"],
"properties": {
"name": {
"type": "string",
"description": "The name of the event subscriber."
},
"class": {
"type": "string",
"description": "The fully qualified class name (FQCN) of the subscriber."
},
"description": {
"type": "string",
"description": "A description of what the subscriber does."
},
"event": {
"type": "string",
"description": "The name of the event being handled."
},
"eventClass": {
"type": "string",
"description": "The fully qualified class name (FQCN) of the event."
}
},
"additionalProperties": false
},
"externalCall": {
"type": "object",
"description": "A call to a command or query in another module/context.",
"required": ["type", "source", "sourceClass", "name", "targetClass", "targetContext", "targetModule"],
"properties": {
"type": {
"type": "string",
"enum": ["command", "query"],
"description": "The type of external call (command or query)."
},
"source": {
"type": "string",
"description": "The name of the class making the external call."
},
"sourceClass": {
"type": "string",
"description": "The fully qualified class name (FQCN) of the source."
},
"name": {
"type": "string",
"description": "The name of the command or query being called."
},
"targetClass": {
"type": "string",
"description": "The fully qualified class name (FQCN) of the target command/query."
},
"targetContext": {
"type": "string",
"description": "The bounded context of the target."
},
"targetModule": {
"type": "string",
"description": "The module of the target."
}
},
"additionalProperties": false
},
"meta": {
"type": "object",
"description": "Metadata about the architecture file.",
"required": ["generatedAt", "project"],
"properties": {
"generatedAt": {
"type": "string",
"format": "date-time",
"description": "The timestamp when the file was generated."
},
"project": {
"type": "string",
"description": "The project name."
},
"company": {
"type": "string",
"description": "The company name of the project."
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}