Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

Commit aa3bc47

Browse files
committed
read new option, #65
1 parent 698c436 commit aa3bc47

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/main/kotlin/io/openapiprocessor/core/converter/ApiOptions.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package io.openapiprocessor.core.converter
77

88
import io.openapiprocessor.core.converter.mapping.Mapping
9+
import io.openapiprocessor.core.support.Empty
910

1011
/**
1112
* Options of the processor.
@@ -45,6 +46,11 @@ class ApiOptions {
4546
*/
4647
var javadoc = false
4748

49+
/**
50+
* suffix for model class names and enum names. Default is none, ie. an empty string.
51+
*/
52+
var modelNameSuffix = String.Empty
53+
4854
/**
4955
* provide additional type mapping information to map OpenAPI types to java types. The list can
5056
* contain the following mappings:

src/main/kotlin/io/openapiprocessor/core/converter/OptionsConverter.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class OptionsConverter(private val checkObsoleteProcessorOptions: Boolean = fals
5353
}
5454
is MappingV2 -> {
5555
options.packageName = mapping.options.packageName
56+
options.modelNameSuffix = mapping.options.modelNameSuffix
5657
options.beanValidation = mapping.options.beanValidation
5758
options.javadoc = mapping.options.javadoc
5859
}

src/test/kotlin/io/openapiprocessor/core/converter/OptionsConverterSpec.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@ class OptionsConverterSpec: StringSpec({
9090
openapi-processor-mapping: v2
9191
options:
9292
package-name: generated
93+
model-name-suffix: Suffix
9394
bean-validation: true
9495
javadoc: true
9596
""".trimIndent()
9697
))
9798

9899
options.packageName shouldBe "generated"
100+
options.modelNameSuffix shouldBe "Suffix"
99101
options.beanValidation shouldBe true
100102
options.javadoc shouldBe true
101103
}

0 commit comments

Comments
 (0)