sdd_mvcp_contract_schema.json
5.79 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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://hermes.ai/sdd-mvcp-contract.schema.json",
"title": "SDD MVCP Contract",
"type": "object",
"required": ["meta", "model_contract", "view_contract", "controller_contract", "process_contract", "acceptance_matrix"],
"properties": {
"meta": {
"type": "object",
"required": ["project", "version", "effective_date"],
"properties": {
"project": {"type": "string"},
"version": {"type": "string"},
"effective_date": {"type": "string"},
"owner": {"type": "string"}
}
},
"model_contract": {
"type": "array",
"minItems": 1,
"items": {"$ref": "#/definitions/modelEntity"}
},
"view_contract": {
"type": "array",
"items": {"$ref": "#/definitions/viewScreen"}
},
"controller_contract": {
"type": "array",
"minItems": 1,
"items": {"$ref": "#/definitions/controllerOp"}
},
"process_contract": {
"type": "array",
"items": {"$ref": "#/definitions/processFlow"}
},
"acceptance_matrix": {
"type": "array",
"items": {
"type": "object",
"required": ["requirement_id", "coverage", "acceptance_cases"],
"properties": {
"requirement_id": {"type": "string"},
"coverage": {
"type": "object",
"required": ["model", "view", "controller", "process"],
"properties": {
"model": {"type": "array", "items": {"type": "string"}},
"view": {"type": "array", "items": {"type": "string"}},
"controller": {"type": "array", "items": {"type": "string"}},
"process": {"type": "array", "items": {"type": "string"}}
}
},
"acceptance_cases": {
"type": "array",
"items": {
"type": "object",
"required": ["type", "description", "expected"],
"properties": {
"type": {"enum": ["happy", "boundary", "failure", "security", "performance"]},
"description": {"type": "string"},
"expected": {"type": "string"}
}
}
}
}
}
}
},
"definitions": {
"modelEntity": {
"type": "object",
"required": ["entity", "fields", "owner"],
"properties": {
"entity": {"type": "string"},
"owner": {"type": "string"},
"purpose": {"type": "string"},
"fields": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "type", "nullable", "constraints"],
"properties": {
"name": {"type": "string"},
"type": {"type": "string"},
"nullable": {"type": "boolean"},
"constraints": {"type": "array", "items": {"type": "string"}},
"index": {"type": "string", "enum": ["idx", "unique", "none"]},
"default": {"type": ["string", "number", "boolean", "null"]}
}
}
}
}
},
"viewScreen": {
"type": "object",
"required": ["view_id", "route", "events", "fields"],
"properties": {
"view_id": {"type": "string"},
"route": {"type": "string"},
"fields": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "visible_when", "validation"],
"properties": {
"name": {"type": "string"},
"visible_when": {"type": "string"},
"validation": {"type": "array", "items": {"type": "string"}},
"required": {"type": "boolean"}
}
}
},
"events": {
"type": "array",
"items": {
"type": "object",
"required": ["event", "target_controller_id", "payload"],
"properties": {
"event": {"type": "string"},
"target_controller_id": {"type": "string"},
"payload": {"type": "object", "additionalProperties": true}
}
}
}
}
},
"controllerOp": {
"type": "object",
"required": ["operation_id", "method", "path", "input", "output", "errors"],
"properties": {
"operation_id": {"type": "string"},
"method": {"enum": ["GET", "POST", "PUT", "PATCH", "DELETE"]},
"path": {"type": "string"},
"auth": {"type": "string"},
"input": {"type": "object", "additionalProperties": true},
"output": {"type": "object", "additionalProperties": true},
"idempotent": {"type": "boolean"},
"errors": {
"type": "array",
"items": {
"type": "object",
"required": ["code", "retryable", "description"],
"properties": {
"code": {"type": "string"},
"retryable": {"type": "boolean"},
"description": {"type": "string"}
}
}
}
}
},
"processFlow": {
"type": "object",
"required": ["flow_id", "start_state", "end_state", "transitions"],
"properties": {
"flow_id": {"type": "string"},
"start_state": {"type": "string"},
"end_state": {"type": "string"},
"transitions": {
"type": "array",
"items": {
"type": "object",
"required": ["from", "to", "trigger", "action", "error_state"],
"properties": {
"from": {"type": "string"},
"to": {"type": "string"},
"trigger": {"type": "string"},
"action": {"type": "string"},
"guard": {"type": "string"},
"error_state": {"type": "string"},
"retry_max": {"type": "integer", "minimum": 0}
}
}
}
}
}
}
}