-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathswagger_to_sdk_config.schema.json
418 lines (418 loc) · 15.9 KB
/
swagger_to_sdk_config.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
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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
{
"$schema": "http://json-schema.org/draft-04/schema",
"type": "object",
"properties": {
"$schema": {
"enum": [
"https://raw.githubusercontent.com/lmazuel/swagger-to-sdk/master/swagger_to_sdk_config.schema.json"
]
},
"meta": {
"type": "object",
"properties": {
"version": {
"enum": [
"0.2.0"
],
"description": "The version must be 0.2.0"
},
"after_scripts": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"description": "List of commands to execute after the generation is done. Will be executed in the order of the list. Current working directory will be the cloned path. See also \"envs\" node."
},
"autorest_options": {
"$ref": "#/definitions/autorest_options"
},
"envs": {
"type": "object",
"patternProperties": {
"sdkrel:.*": {
"type": "string",
"description": "All options prefixed by \"sdkrel:\" can be a relative path that will be solved against SDK folder before being sent to Autorest."
}
},
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "boolean"
},
{
"type": "number"
}
]
},
"description": "Environment variables for after_scripts. All options prefixed by \"sdkrel:\" can be a relative path that will be solved against SDK folder before being sent to the scripts."
},
"advanced_options": {
"type": "object",
"properties": {
"clone_dir": {
"type": "string",
"minLength": 1,
"description": "Add more layers of folders to clone the repo, if necessary. Right now, useful for Go only. \"sdkrel:\" will consider this as the final folder path."
}
},
"patternProperties": {
"sdkrel:.*": {
"$ref": "#/definitions/sdkrelProperty"
}
},
"description": ""
},
"wrapper_filesOrDirs": {
"$ref": "#/definitions/wrapper_filesOrDirs"
},
"delete_filesOrDirs": {
"$ref": "#/definitions/delete_filesOrDirs"
},
"generated_relative_base_directory": {
"$ref": "#/definitions/generated_relative_base_directory"
}
},
"additionalProperties": false,
"required": [
"version"
]
},
"projects": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"markdown": {
"type": "string",
"minLength": 1,
"description": "This is an optional parameter which specificy the Autorest MD file path for this project. This is relative to the rest-folder paramter."
},
"autorest_options": {
"$ref": "#/definitions/autorest_options"
},
"wrapper_filesOrDirs": {
"$ref": "#/definitions/wrapper_filesOrDirs"
},
"delete_filesOrDirs": {
"$ref": "#/definitions/delete_filesOrDirs"
},
"generated_relative_base_directory": {
"$ref": "#/definitions/generated_relative_base_directory"
},
"output_dir": {
"type": "string",
"minLength": 1,
"description": "This is the folder in your SDK repository where you want to put the generated files."
},
"build_dir": {
"type": "string",
"minLength": 1,
"description": "This is an optional folder where to put metadata about the generation (Autorest version, date of generation, etc.). This can be used by our monitoring system to detect package that needs an update. Be sure this folder is unique in the entire file, to avoid overwritting a file from another project."
}
},
"additionalProperties": false,
"description": ""
},
"description": "It's a dict where keys are a project id. The project id has no constraint, but it's recommended to use namespace style, like \"datalake.store.account\" to provide the best flexibility for the --project parameter."
}
},
"additionalProperties": false,
"required": [
"meta"
],
"definitions": {
"autorest_options": {
"properties": {
"verbose": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nShow verbose output information."
},
"debug": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nShow internal debug information."
},
"quiet": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nSuppress output."
},
"list-installed": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nShow all installed versions of AutoRest tools."
},
"list-available": {
"type": "number",
"minimum": 1,
"default": 10,
"description": "An option that will be passed to autorest.\nLists the last nn releases available from github."
},
"version": {
"type": "string",
"minLength": 1,
"description": "An option that will be passed to autorest.\nUses specified version of AutoRest (installing if necessary.)\nFor version you can use a version label (see --list-available) or\n-latest: Get latest nightly build.\n-latest-release: Get latest release version."
},
"reset": {
"enum": [
""
],
"description": "An option that will be passed to autorest.\nRemove all installed versions of AutoRest tools and install the latest (override with --version)."
},
"runtime-id": {
"type": "string",
"minLength": 1,
"description": "An option that will be passed to autorest.\nOverrides the platform detection for the dotnet runtime (special case). Refer to the Runtime Identifier (RID) catalog for more details."
},
"input-file": {
"type": "string",
"minLength": 1,
"description": "An option that will be passed to autorest.\nAdds the given file to the list of input files for generation process."
},
"namespace": {
"type": "string",
"minLength": 1,
"description": "An option that will be passed to autorest.\nSets the namespace to use for the generated code."
},
"license-header": {
"type": "string",
"minLength": 1,
"description": "An option that will be passed to autorest.\nText to include as a header comment in generated files. Use NONE to suppress the default header."
},
"add-credentials": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nIf specified, the generated client includes a ServiceClientCredentials property and constructor parameter. Authentication behaviors are implemented by extending the ServiceClientCredentials type."
},
"package-name": {
"type": "string",
"minLength": 1,
"description": "An option that will be passed to autorest.\nName of the package."
},
"package-version": {
"type": "string",
"minLength": 1,
"description": "An option that will be passed to autorest.\nVersion of the package."
},
"sync-methods": {
"enum": [
"essential",
"all",
"none"
],
"description": "An option that will be passed to autorest.\nSpecifies mode for generating sync wrappers. Supported value are:\nessential - generates only one sync returning body or header (default)\nall - generates one sync method for each async method\nnone - does not generate any sync methods"
},
"payload-flattening-threshold": {
"type": "number",
"minimum": 1,
"description": "An option that will be passed to autorest.\nThe maximum number of properties in the request body. If the number of properties in the request body is less than or equal to this value, these properties will be represented as method arguments."
},
"override-client-name": {
"type": "string",
"minLength": 1,
"description": "An option that will be passed to autorest.\nName to use for the generated client type. By default, uses the value of the 'Title' field from the input files."
},
"use-internal-constructors": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nIndicates whether generated constructors will have an internal protection level."
},
"use-datetimeoffset": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nIndicates whether to use DateTimeOffset instead of DateTime to model date-time types."
},
"models-name": {
"type": "string",
"minLength": 1,
"description": "An option that will be passed to autorest.\nName to use for the generated client models namespace and folder name. By default, uses the value of 'Models'. This is not currently supported by all code generators."
},
"output-file": {
"type": "string",
"minLength": 1,
"description": "An option that will be passed to autorest.\nIf set, will cause generated code to be output to a single file. Not supported by all code generators."
},
"message-format": {
"enum": [
"regular",
"json"
],
"description": "An option that will be passed to autorest.\nSpecifies the format, messages will be printed as. JSON format is easier to process programmatically."
},
"azure-validator": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nIf set, runs the Azure specific validator plugin."
},
"openapi-type": {
"enum": [
"arm",
"default",
"data-plane"
],
"description": "An option that will be passed to autorest.\nIndicates the type of configuration file being passed to the azure-validator so that it can run the appropriate class of validation rules accordingly."
},
"model-validator": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nIf set, validates the provided OpenAPI definition(s) against provided examples."
},
"semantic-validator": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nIf set, semantically verifies the provided OpenAPI definition(s), e.g. checks that a parameter's specified default value matches the parameter's declared type."
},
"csharp": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nRuns the C# code generator."
},
"nodejs": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nRuns the Node.js JavaScript code generator."
},
"python": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nRuns the Python code generator."
},
"java": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nRuns the Java code generator."
},
"ruby": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nRuns the Ruby code generator."
},
"go": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nRuns the Go code generator."
},
"typescript": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nRuns the TypeScript code generator."
},
"azureresourceschema": {
"enum": [
"",
true,
false
],
"description": "An option that will be passed to autorest.\nRuns the Azure Resource Schema code generator."
},
"azure-arm": {
"type": "boolean",
"description": "An option that will be passed to autorest.\nUses the Azure version of the specified code generator."
}
},
"patternProperties": {
"sdkrel:.*": {
"$ref": "#/definitions/sdkrelProperty"
}
},
"additionalProperties": {
"oneOf": [
{
"type": "string",
"description": "An option that will be passed to autorest."
},
{
"type": "boolean",
"description": "An option that will be passed to autorest."
},
{
"type": "number",
"description": "An option that will be passed to autorest."
}
]
},
"description": "An optional dictionary of options you want to pass to Autorest. This will be passed in any call, but can be override by \"autorest_options\" in each data. Note that you CAN'T override \"--output-folder\" which is filled contextually. All options prefixed by \"sdkrel:\" can be a relative path that will be solved against SDK folder before being sent to Autorest."
},
"wrapper_filesOrDirs": {
"type": "array",
"items": {
"type": "string",
"description": "A file/directory that will be kept from the generated SDK."
},
"description": "An optional list of files/directory to keep when we generate new SDK. This support a Bash-like wildcard syntax (i.e. '*/myfile?.py'). This applies to every Swagger files."
},
"delete_filesOrDirs": {
"type": "array",
"items": {
"type": "string",
"description": "A file/directory that will be deleted from the generated SDK."
},
"description": "An optional list of files/directory to delete from the generated SDK. This support a Bash-like wildcard syntax (i.e. '*/myfile?.py') This applies to every Swagger files."
},
"generated_relative_base_directory": {
"type": "string",
"minLength": 1,
"description": "If the data to consider generated by Autorest are not directly in the root folder. For instance, if Autorest generates a networkclient folder and you want to consider this folder as the root of data. This parameter is applied before 'delete_filesOrDirs', consider it in your paths. This applies to every Swagger files."
},
"sdkrelProperty": {
"type": "string",
"description": "All options prefixed by \"sdkrel:\" can be a relative path that will be solved against SDK folder before being sent to Autorest."
}
}
}