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
Introduced a new property `inputSpecRootDirectorySkipMerge` to conditionally skip the merging step of the specification files. Updated the logic to honor this new property, ensuring merging only occurs if it is explicitly not skipped. Enabled configuration via Gradle build file.
Copy file name to clipboardexpand all lines: modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt
+1
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,7 @@ class OpenApiGeneratorPlugin : Plugin<Project> {
Copy file name to clipboardexpand all lines: modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt
+16-1
Original file line number
Diff line number
Diff line change
@@ -51,14 +51,28 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
51
51
52
52
/**
53
53
* The Open API 2.0/3.x specification location.
54
+
*
55
+
* Be default, Gradle will treat the openApiGenerate task as up-to-date based only on this file, regardless of
56
+
* changes to any $ref referenced files. Use the `inputSpecRootDirectory` property to have Gradle track changes to
57
+
* an entire directory of spec files.
54
58
*/
55
59
val inputSpec = project.objects.property<String>()
56
60
57
61
/**
58
-
* Local root folder with spec files
62
+
* Local root folder with spec files.
63
+
*
64
+
* By default, a merged spec file will be generated based on the contents of the directory. To disable this, set the
65
+
* `inputSpecRootDirectorySkipMerge` property.
59
66
*/
60
67
val inputSpecRootDirectory = project.objects.property<String>()
61
68
69
+
/**
70
+
* Skip bundling all spec files into a merged spec file, if true.
71
+
*
72
+
* Default false.
73
+
*/
74
+
val inputSpecRootDirectorySkipMerge = project.objects.property<Boolean>()
75
+
62
76
/**
63
77
* The remote Open API 2.0/3.x specification URL location.
64
78
*/
@@ -400,6 +414,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
Copy file name to clipboardexpand all lines: modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt
+25-4
Original file line number
Diff line number
Diff line change
@@ -106,20 +106,34 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
106
106
107
107
/**
108
108
* The Open API 2.0/3.x specification location.
109
+
*
110
+
* Be default, Gradle will treat the openApiGenerate task as up-to-date based only on this file, regardless of
111
+
* changes to any $ref referenced files. Use the `inputSpecRootDirectory` property to have Gradle track changes to
112
+
* an entire directory of spec files.
109
113
*/
110
114
@Optional
111
115
@get:InputFile
112
116
@PathSensitive(PathSensitivity.RELATIVE)
113
117
val inputSpec = project.objects.property<String>()
114
118
115
119
/**
116
-
* Local root folder with spec files
120
+
* Local root folder with spec files.
121
+
*
122
+
* By default, a merged spec file will be generated based on the contents of the directory. To disable this, set the
123
+
* `inputSpecRootDirectorySkipMerge` property.
117
124
*/
118
125
@Optional
119
126
@get:InputDirectory
120
127
@PathSensitive(PathSensitivity.RELATIVE)
121
128
val inputSpecRootDirectory = project.objects.property<String>();
122
129
130
+
/**
131
+
* Skip bundling all spec files into a merged spec file, if true.
132
+
*/
133
+
@Input
134
+
@Optional
135
+
val inputSpecRootDirectorySkipMerge = project.objects.property<Boolean>()
136
+
123
137
/**
124
138
* Name of the file that will contain all merged specs
125
139
*/
@@ -625,9 +639,16 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
0 commit comments