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
Not all generators support thess features yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly. We also welcome PRs to add these features to generators. Related PRs for reference: #16209, #16234 (modelNameMappings), #16194, #16206 (nameMappings, parameterNameMappings).
424
+
To map enum names, use `enumNameMappings` option, e.g.
Not all generators support thess features yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly. We also welcome PRs to add these features to generators. Related PRs for reference: #16209, #16234 (modelNameMappings), #16194, #16206 (nameMappings, parameterNameMappings), #17108 (enumNameMappings).
425
431
426
432
NOTE: some generators use `baseName` (original name obtained direclty from OpenAPI spec, e.g. `shipping-date`) mustache tag in the templates so the mapping feature won't work.
Copy file name to clipboardExpand all lines: modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -182,6 +182,11 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
182
182
*/
183
183
val modelNameMappings = project.objects.mapProperty<String, String>()
184
184
185
+
/**
186
+
* Specifies mappings between an enum name and the new name
187
+
*/
188
+
val enumNameMappings = project.objects.mapProperty<String, String>()
189
+
185
190
/**
186
191
* Specifies mappings (rules) in OpenAPI normalizer
Copy file name to clipboardExpand all lines: modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -293,6 +293,13 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
293
293
@Input
294
294
val modelNameMappings = project.objects.mapProperty<String, String>()
295
295
296
+
/**
297
+
* Specifies mappings between the enum name and the new name
298
+
*/
299
+
@Optional
300
+
@Input
301
+
val enumNameMappings = project.objects.mapProperty<String, String>()
302
+
296
303
/**
297
304
* Specifies mappings (rules) in OpenAPI normalizer
298
305
*/
@@ -852,6 +859,12 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
0 commit comments