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: docs/customization.md
+13
Original file line number
Diff line number
Diff line change
@@ -451,3 +451,16 @@ Another useful option is `inlineSchemaNameDefaults`, which allows you to customi
451
451
```
452
452
453
453
Note: Only arrayItemSuffix, mapItemSuffix are supported at the moment. `SKIP_SCHEMA_REUSE=true` is a special value to skip reusing inline schemas.
454
+
455
+
## OpenAPI Normalizer
456
+
457
+
OpenAPI Normalizer (off by default) transforms the input OpenAPI doc/spec (which may not perfectly conform to the specification) to make it workable with OpenAPI Generator. Here is a list of rules supported:
458
+
459
+
- `REF_AS_PARENT_IN_ALLOF`: when set to `true`, child schemas in `allOf` is considered a parent if it's a `$ref` (instead of inline schema)
Copy file name to clipboardExpand all lines: modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java
+15
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,9 @@ public class ConfigHelp extends OpenApiGeneratorCommand {
80
80
@Option(name = {"--inline-schema-name-defaults"}, title = "inline schema name defaults", description = "default values used when naming inline schema name")
81
81
privateBooleaninlineSchemaNameDefaults;
82
82
83
+
@Option(name = {"--openapi-normalizer"}, title = "openapi normalizer rules", description = "displays the OpenAPI normalizer rules (none)")
84
+
privateBooleanopenapiNormalizer;
85
+
83
86
@Option(name = {"--metadata"}, title = "metadata", description = "displays the generator metadata like the help txt for the generator and generator type etc")
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
@@ -118,6 +118,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
+5
Original file line number
Diff line number
Diff line change
@@ -162,6 +162,11 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
162
162
*/
163
163
val inlineSchemaNameDefaults = project.objects.mapProperty<String, String>()
164
164
165
+
/**
166
+
* Specifies mappings (rules) in OpenAPI normalizer
167
+
*/
168
+
val openapiNormalizer = project.objects.mapProperty<String, String>()
Copy file name to clipboardExpand all lines: modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt
+13
Original file line number
Diff line number
Diff line change
@@ -250,6 +250,13 @@ open class GenerateTask : DefaultTask() {
250
250
@Input
251
251
val inlineSchemaNameDefaults = project.objects.mapProperty<String, String>()
252
252
253
+
/**
254
+
* Specifies mappings (rules) in OpenAPI normalizer
255
+
*/
256
+
@Optional
257
+
@Input
258
+
val openapiNormalizer = project.objects.mapProperty<String, String>()
259
+
253
260
/**
254
261
* Root package for generated code.
255
262
*/
@@ -758,6 +765,12 @@ open class GenerateTask : DefaultTask() {
0 commit comments