You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt
Copy file name to clipboardExpand all lines: modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt
+29-70Lines changed: 29 additions & 70 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
* you may not use this file except in compliance with the License.
6
6
* You may obtain a copy of the License at
7
7
*
8
-
* https://www.apache.org/licenses/LICENSE-2.0
8
+
* https://www.apache.org/licenses/LICENSE-2.0
9
9
*
10
10
* Unless required by applicable law or agreed to in writing, software
11
11
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -47,7 +47,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
47
47
/**
48
48
* The output target directory into which code will be generated.
49
49
*/
50
-
val outputDir= project.objects.property<String>()
50
+
val outputDir:DirectoryProperty= project.objects.directoryProperty()
51
51
52
52
/**
53
53
* The Open API 2.0/3.x specification location.
@@ -56,15 +56,15 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
56
56
* changes to any $ref referenced files. Use the `inputSpecRootDirectory` property to have Gradle track changes to
57
57
* an entire directory of spec files.
58
58
*/
59
-
val inputSpec= project.objects.property<String>()
59
+
val inputSpec:RegularFileProperty= project.objects.fileProperty()
60
60
61
61
/**
62
62
* Local root folder with spec files.
63
63
*
64
64
* By default, a merged spec file will be generated based on the contents of the directory. To disable this, set the
65
65
* `inputSpecRootDirectorySkipMerge` property.
66
66
*/
67
-
val inputSpecRootDirectory= project.objects.property<String>()
67
+
val inputSpecRootDirectory:DirectoryProperty= project.objects.directoryProperty()
68
68
69
69
/**
70
70
* Skip bundling all spec files into a merged spec file, if true.
@@ -81,7 +81,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
81
81
/**
82
82
* The template directory holding a custom template.
83
83
*/
84
-
val templateDir= project.objects.property<String>()
84
+
val templateDir:DirectoryProperty= project.objects.directoryProperty()
85
85
86
86
/**
87
87
* The template location (which may be a directory or a classpath location) holding custom templates.
@@ -104,7 +104,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
104
104
* File content should be in a json format { "optionKey":"optionValue", "optionKey1":"optionValue1"...}
105
105
* Supported options can be different for each language. Run config-help -g {generator name} command for language specific config options.
106
106
*/
107
-
val configFile= project.objects.property<String>()
107
+
val configFile:RegularFileProperty= project.objects.fileProperty()
108
108
109
109
/**
110
110
* Specifies if the existing files should be overwritten during the generation.
@@ -167,7 +167,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
167
167
val languageSpecificPrimitives = project.objects.listProperty<String>()
168
168
169
169
/**
170
-
* Specifies .openapi-generator-ignore list in the form of relative/path/to/file1,relative/path/to/file2. For example: README.md,pom.xml.
170
+
* Specifies .openapi-generator-ignore list in the form of relative/path/to/file1,relative/path/to/file2. For example: README.md,pom.xml.
171
171
*/
172
172
val openapiGeneratorIgnoreList = project.objects.listProperty<String>()
173
173
@@ -279,7 +279,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
279
279
/**
280
280
* Specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.
281
281
*/
282
-
val ignoreFileOverride= project.objects.property<String>()
282
+
val ignoreFileOverride:RegularFileProperty= project.objects.fileProperty()
283
283
284
284
/**
285
285
* Remove prefix of operationId, e.g. config_getId => getId
@@ -293,71 +293,36 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
293
293
294
294
/**
295
295
* Defines which API-related files should be generated. This allows you to create a subset of generated files (or none at all).
296
-
*
297
-
* NOTE: Configuring any one of [apiFilesConstrainedTo], [modelFilesConstrainedTo], or [supportingFilesConstrainedTo] results
298
-
* in others being disabled. That is, OpenAPI Generator considers any one of these to define a subset of generation.
299
-
* For more control over generation of individual files, configure an ignore file and refer to it via [ignoreFileOverride].
300
296
*/
301
297
val apiFilesConstrainedTo = project.objects.listProperty<String>()
302
298
303
299
/**
304
300
* Defines which model-related files should be generated. This allows you to create a subset of generated files (or none at all).
305
-
*
306
-
* NOTE: Configuring any one of [apiFilesConstrainedTo], [modelFilesConstrainedTo], or [supportingFilesConstrainedTo] results
307
-
* in others being disabled. That is, OpenAPI Generator considers any one of these to define a subset of generation.
308
-
* For more control over generation of individual files, configure an ignore file and refer to it via [ignoreFileOverride].
309
301
*/
310
302
val modelFilesConstrainedTo = project.objects.listProperty<String>()
311
303
312
304
/**
313
305
* Defines which supporting files should be generated. This allows you to create a subset of generated files (or none at all).
314
-
*
315
-
* Supporting files are those related to `projects/frameworks` which may be modified
316
-
* by consumers.
317
-
*
318
-
* NOTE: Configuring any one of [apiFilesConstrainedTo], [modelFilesConstrainedTo], or [supportingFilesConstrainedTo] results
319
-
* in others being disabled. That is, OpenAPI Generator considers any one of these to define a subset of generation.
320
-
* For more control over generation of individual files, configure an ignore file and refer to it via [ignoreFileOverride].
321
306
*/
322
307
val supportingFilesConstrainedTo = project.objects.listProperty<String>()
323
308
324
309
/**
325
310
* Defines whether model-related _test_ files should be generated.
326
-
*
327
-
* This option enables/disables generation of ALL model-related _test_ files.
328
-
*
329
-
* For more control over generation of individual files, configure an ignore file and
330
-
* refer to it via [ignoreFileOverride].
331
311
*/
332
312
val generateModelTests = project.objects.property<Boolean>()
333
313
334
314
/**
335
315
* Defines whether model-related _documentation_ files should be generated.
336
-
*
337
-
* This option enables/disables generation of ALL model-related _documentation_ files.
338
-
*
339
-
* For more control over generation of individual files, configure an ignore file and
340
-
* refer to it via [ignoreFileOverride].
341
316
*/
342
317
val generateModelDocumentation = project.objects.property<Boolean>()
343
318
344
319
/**
345
320
* Defines whether api-related _test_ files should be generated.
346
-
*
347
-
* This option enables/disables generation of ALL api-related _test_ files.
348
-
*
349
-
* For more control over generation of individual files, configure an ignore file and
350
-
* refer to it via [ignoreFileOverride].
351
321
*/
352
322
val generateApiTests = project.objects.property<Boolean>()
353
323
354
324
/**
355
325
* Defines whether api-related _documentation_ files should be generated.
356
-
*
357
-
* This option enables/disables generation of ALL api-related _documentation_ files.
358
-
*
359
-
* For more control over generation of individual files, configure an ignore file and
360
-
* refer to it via [ignoreFileOverride].
361
326
*/
362
327
val generateApiDocumentation = project.objects.property<Boolean>()
363
328
@@ -368,9 +333,6 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
368
333
369
334
/**
370
335
* To enable the file post-processing hook. This enables executing an external post-processor (usually a linter program).
371
-
* This only enables the post-processor. To define the post-processing command, define an environment variable such as
372
-
* LANG_POST_PROCESS_FILE (e.g. GO_POST_PROCESS_FILE, SCALA_POST_PROCESS_FILE). Please open an issue if your target
373
-
* generator does not support this functionality.
374
336
*/
375
337
val enablePostProcessFile = project.objects.property<Boolean>()
376
338
@@ -380,9 +342,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
380
342
val skipValidateSpec = project.objects.property<Boolean>()
381
343
382
344
/**
383
-
* To generate alias (array, list, map) as model. When false, top-level objects defined as array, list, or map will result in those
384
-
* definitions generated as top-level Array-of-items, List-of-items, Map-of-items definitions.
385
-
* When true, A model representation either containing or extending the array,list,map (depending on specific generator implementation) will be generated.
345
+
* To generate alias (array, list, map) as model.
386
346
*/
387
347
val generateAliasAsModel = project.objects.property<Boolean>()
388
348
@@ -398,7 +358,6 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
398
358
399
359
/**
400
360
* Defines whether the output dir should be cleaned up before generating the output.
401
-
*
402
361
*/
403
362
val cleanupOutput = project.objects.property<Boolean>()
404
363
@@ -413,22 +372,22 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
0 commit comments