-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.json
235 lines (235 loc) · 6.46 KB
/
schema.json
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
{
"$id": "https://msstack.grydtech.com/schema",
"$schema": "http://json-schema.org/draft-07/schema",
"title": "MSstack Model Specification",
"description": "Model specification for MSstack. This schema is the standard followed by the model for generating business processes and creating microservices.",
"type": "object",
"required": ["entities", "requests", "responses", "events", "contracts", "version"],
"properties": {
"version": {
"title": "Version",
"description": "The veresion of the schema",
"type": "string"
},
"entities": {
"title": "Entities",
"description": "The entities involved in a business process",
"type": "array",
"items": { "$ref": "#/definitions/entity" }
},
"events": {
"title": "Events",
"description": "The events that propagate the business processes.",
"type": "array",
"items": { "$ref": "#/definitions/event" }
},
"requests": {
"title": "Requests",
"description": "The types of requests that the application can accept",
"type": "array",
"items": { "$ref": "#/definitions/request" }
},
"responses": {
"title": "Responses",
"description": "The types of responses that the application can provide",
"type": "array",
"items": { "$ref": "#/definitions/response" }
},
"contracts": {
"title": "Contracts",
"description": "The types of contracts that the application can execute within a business process",
"type": "array",
"items": { "$ref": "#/definitions/contract" }
}
},
"definitions": {
"field": {
"title": "Field",
"description": "The schema for a field in MSstack",
"type": "object",
"required": ["name", "type", "constraints"],
"propertyNames": true,
"properties": {
"name": {
"title": "Name",
"description": "Name of the field",
"type": "string"
},
"type": {
"title": "Type",
"description": "The type of the field",
"anyOf": [
{ "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] },
{
"type": "string",
"format": "uri-reference"
}
]
},
"constraints": {
"title": "Constraints",
"description": "The behavior of the field as defined by the set of constraints",
"type": "array",
"items": {
"enum": ["NOT_NULL", "UNIQUE", "PRIMARY_KEY"]
}
}
}
},
"entity": {
"title": "Entity",
"description": "The schema for an entity in MSstack",
"type": "object",
"propertyNames": true,
"properties": {
"name": {
"title": "Name",
"description": "The name of the Entity",
"type": "string"
},
"fields": {
"title": "Fields",
"description": "The fields belonging to an entity",
"type": "array",
"items": { "$ref": "#/definitions/field" }
}
}
},
"event": {
"title": "Event",
"description": "The schema for an event in MSstack",
"type": "object",
"propertyNames": true,
"properties": {
"name": {
"title": "Name",
"description": "The name of the event",
"type": "string"
},
"entity": {
"title": "Entity",
"description": "A reference to the entity that this event is applicable to",
"type": "string",
"format": "uri-reference"
},
"fields": {
"title": "Fields",
"description": "The fields belonging to an event",
"type": "array",
"items": { "$ref": "#/definitions/field" }
}
}
},
"request": {
"title": "Request",
"description": "The schema for a request in MSstack",
"type": "object",
"propertyNames": true,
"properties": {
"name": {
"title": "Name",
"description": "The name of the request",
"type": "string"
},
"entity": {
"title": "Entity",
"description": "A reference to the primary entity that this request applies to",
"type": "string",
"format": "uri-reference"
},
"fields": {
"title": "Fields",
"description": "The fields belonging to a request",
"type": "array",
"items": { "$ref": "#/definitions/field" }
}
}
},
"response": {
"title": "Response",
"description": "The schema for a response in MSstack",
"type": "object",
"propertyNames": true,
"properties": {
"name": {
"title": "Name",
"description": "The name of the response",
"type": "string"
},
"entity": {
"title": "Entity",
"description": "A reference to the primary entity that this response provides information about",
"type": "string",
"format": "uri-reference"
},
"fields": {
"title": "Fields",
"description": "The fields belonging to this response",
"type": "array",
"items": {
"$ref": "#/definitions/field"
}
}
}
},
"contract": {
"title": "Contract",
"description": "The schema for a contract in MSstack",
"type": "object",
"propertyNames": true,
"properties": {
"name": {
"title": "Name",
"description": "The name of the contract",
"type": "string"
},
"description": {
"title": "Description",
"description": "A long description of the contract. This description is rendered into a comment in the code generated using this model",
"type": "string"
},
"entity": {
"title": "Entity",
"description": "A reference to the entity that this contract applies to. A contract can only have one entity that it is applied to",
"type": "string",
"format": "uri-reference"
},
"type": {
"title": "Type",
"description": "The type of the contract. A contract can be of either COMMAND or an EVENT",
"enum": ["COMMAND", "EVENT"]
},
"consumes": {
"title": "Consumes",
"description": "The type of requests or events that this contract consumes",
"type": "string",
"format": "uri-reference"
},
"produces": {
"title": "Produces",
"description": "The types of events or responses that this contract produces. They are categorized into two states, on success or on failure.",
"type": "object",
"properties": {
"on_success": {
"title": "On Success",
"description": "The outputs that the contract produces on success",
"type": "array",
"items": [{ "type": "string", "format": "uri-reference" }]
},
"on_failure": {
"title": "On Failure",
"description": "The outputs that the contract produces on failure",
"type": "array",
"items": [
{
"type": "string",
"format": "uri-reference"
}
]
}
}
}
}
}
}
}