-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtypeschema.json
313 lines (313 loc) · 9.36 KB
/
typeschema.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
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
307
308
309
310
311
312
313
{
"definitions": {
"DefinitionType": {
"description": "Base definition type",
"type": "struct",
"base": true,
"properties": {
"description": {
"description": "",
"type": "string"
},
"type": {
"description": "",
"type": "string"
},
"deprecated": {
"description": "",
"type": "boolean"
}
},
"discriminator": "type",
"mapping": {
"StructDefinitionType": "struct",
"MapDefinitionType": "map",
"ArrayDefinitionType": "array"
}
},
"StructDefinitionType": {
"description": "A struct represents a class/structure with a fix set of defined properties",
"type": "struct",
"parent": {
"type": "reference",
"target": "DefinitionType"
},
"properties": {
"parent": {
"description": "Defines a parent type, all properties from the parent type are inherited",
"type": "reference",
"target": "ReferencePropertyType"
},
"base": {
"description": "Indicates whether this is a base structure, default is false. If true the structure is used a base type, this means it is not possible to create an instance from this structure",
"type": "boolean"
},
"properties": {
"description": "Contains a map of available properties for this struct",
"type": "map",
"schema": {
"type": "reference",
"target": "PropertyType"
}
},
"discriminator": {
"description": "Optional the property name of a discriminator property. This should be only used in case this is also a base structure",
"type": "string"
},
"mapping": {
"description": "In case a discriminator is configured it is required to configure a mapping. The mapping is a map where the key is the type name (a key from the definitions map) and the value the actual discriminator type value",
"type": "map",
"schema": {
"type": "string"
}
}
}
},
"CollectionDefinitionType": {
"description": "Base collection type",
"type": "struct",
"parent": {
"type": "reference",
"target": "DefinitionType"
},
"base": true,
"properties": {
"type": {
"description": "",
"type": "string"
},
"schema": {
"description": "",
"type": "reference",
"target": "PropertyType"
}
},
"discriminator": "type",
"mapping": {
"MapDefinitionType": "map",
"ArrayDefinitionType": "array"
}
},
"MapDefinitionType": {
"description": "Represents a map which contains a dynamic set of key value entries of the same type",
"type": "struct",
"parent": {
"type": "reference",
"target": "CollectionDefinitionType"
}
},
"ArrayDefinitionType": {
"description": "Represents an array which contains a dynamic list of values of the same type",
"type": "struct",
"parent": {
"type": "reference",
"target": "CollectionDefinitionType"
}
},
"PropertyType": {
"description": "Base property type",
"type": "struct",
"base": true,
"properties": {
"description": {
"description": "",
"type": "string"
},
"type": {
"description": "",
"type": "string"
},
"deprecated": {
"description": "",
"type": "boolean"
},
"nullable": {
"description": "",
"type": "boolean"
}
},
"discriminator": "type",
"mapping": {
"StringPropertyType": "string",
"IntegerPropertyType": "integer",
"NumberPropertyType": "number",
"BooleanPropertyType": "boolean",
"MapPropertyType": "map",
"ArrayPropertyType": "array",
"AnyPropertyType": "any",
"GenericPropertyType": "generic",
"ReferencePropertyType": "reference"
}
},
"ScalarPropertyType": {
"description": "Base scalar property type",
"type": "struct",
"parent": {
"type": "reference",
"target": "PropertyType"
},
"base": true,
"properties": {
"type": {
"description": "",
"type": "string"
}
},
"discriminator": "type",
"mapping": {
"StringPropertyType": "string",
"IntegerPropertyType": "integer",
"NumberPropertyType": "number",
"BooleanPropertyType": "boolean"
}
},
"StringPropertyType": {
"description": "Represents a string value",
"type": "struct",
"parent": {
"type": "reference",
"target": "ScalarPropertyType"
},
"properties": {
"format": {
"description": "Optional describes the format of the string. Supported are the following types: date, date-time and time. A code generator may use a fitting data type to represent such a format, if not supported it should fallback to a string",
"type": "string"
}
}
},
"IntegerPropertyType": {
"description": "Represents an integer value",
"type": "struct",
"parent": {
"type": "reference",
"target": "ScalarPropertyType"
}
},
"NumberPropertyType": {
"description": "Represents a float value",
"type": "struct",
"parent": {
"type": "reference",
"target": "ScalarPropertyType"
}
},
"BooleanPropertyType": {
"description": "Represents a boolean value",
"type": "struct",
"parent": {
"type": "reference",
"target": "ScalarPropertyType"
}
},
"CollectionPropertyType": {
"description": "Base collection property type",
"type": "struct",
"parent": {
"type": "reference",
"target": "PropertyType"
},
"base": true,
"properties": {
"type": {
"description": "",
"type": "string"
},
"schema": {
"description": "",
"type": "reference",
"target": "PropertyType"
}
},
"discriminator": "type",
"mapping": {
"MapPropertyType": "map",
"ArrayPropertyType": "array"
}
},
"MapPropertyType": {
"description": "Represents a map which contains a dynamic set of key value entries of the same type",
"type": "struct",
"parent": {
"type": "reference",
"target": "CollectionPropertyType"
}
},
"ArrayPropertyType": {
"description": "Represents an array which contains a dynamic list of values of the same type",
"type": "struct",
"parent": {
"type": "reference",
"target": "CollectionPropertyType"
}
},
"AnyPropertyType": {
"description": "Represents an any value which allows any kind of value",
"type": "struct",
"parent": {
"type": "reference",
"target": "PropertyType"
}
},
"GenericPropertyType": {
"description": "Represents a generic value which can be replaced with a concrete type",
"type": "struct",
"parent": {
"type": "reference",
"target": "PropertyType"
},
"properties": {
"name": {
"description": "The name of the generic, it is recommended to use common generic names like T or TValue. These generics can then be replaced on usage with a concrete type through the template property at a reference",
"type": "string"
}
}
},
"ReferencePropertyType": {
"description": "Represents a reference to a definition type",
"type": "struct",
"parent": {
"type": "reference",
"target": "PropertyType"
},
"properties": {
"target": {
"description": "The target type, this must be a key which is available at the definitions map",
"type": "string"
},
"template": {
"description": "A map where the key is the name of the generic and the value must point to a key under the definitions keyword. This can be used in case the target points to a type which contains generics, then it is possible to replace those generics with a concrete type",
"type": "map",
"schema": {
"type": "string"
}
}
}
},
"TypeSchema": {
"description": "TypeSchema specification",
"type": "struct",
"properties": {
"import": {
"description": "Allows to import other TypeSchema documents. It contains a map where the key is the namespace and the value points to a remote document. The value is a URL and a code generator should support at least the following schemes: file, http, https",
"type": "map",
"schema": {
"type": "string"
}
},
"definitions": {
"description": "",
"type": "map",
"schema": {
"type": "reference",
"target": "DefinitionType"
}
},
"root": {
"description": "Specifies the root type of your specification, this must be a key which is available at the definitions map",
"type": "string"
}
}
}
},
"root": "TypeSchema"
}