This repository was archived by the owner on Mar 16, 2025. It is now read-only.
File tree 3 files changed +9
-0
lines changed
main/kotlin/io/openapiprocessor/core/converter
test/kotlin/io/openapiprocessor/core/converter
3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 6
6
package io.openapiprocessor.core.converter
7
7
8
8
import io.openapiprocessor.core.converter.mapping.Mapping
9
+ import io.openapiprocessor.core.support.Empty
9
10
10
11
/* *
11
12
* Options of the processor.
@@ -45,6 +46,11 @@ class ApiOptions {
45
46
*/
46
47
var javadoc = false
47
48
49
+ /* *
50
+ * suffix for model class names and enum names. Default is none, ie. an empty string.
51
+ */
52
+ var modelNameSuffix = String .Empty
53
+
48
54
/* *
49
55
* provide additional type mapping information to map OpenAPI types to java types. The list can
50
56
* contain the following mappings:
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ class OptionsConverter(private val checkObsoleteProcessorOptions: Boolean = fals
53
53
}
54
54
is MappingV2 -> {
55
55
options.packageName = mapping.options.packageName
56
+ options.modelNameSuffix = mapping.options.modelNameSuffix
56
57
options.beanValidation = mapping.options.beanValidation
57
58
options.javadoc = mapping.options.javadoc
58
59
}
Original file line number Diff line number Diff line change @@ -90,12 +90,14 @@ class OptionsConverterSpec: StringSpec({
90
90
openapi-processor-mapping: v2
91
91
options:
92
92
package-name: generated
93
+ model-name-suffix: Suffix
93
94
bean-validation: true
94
95
javadoc: true
95
96
""".trimIndent()
96
97
))
97
98
98
99
options.packageName shouldBe " generated"
100
+ options.modelNameSuffix shouldBe " Suffix"
99
101
options.beanValidation shouldBe true
100
102
options.javadoc shouldBe true
101
103
}
You can’t perform that action at this time.
0 commit comments