File tree 3 files changed +11
-0
lines changed
openapi-processor-core/src
main/kotlin/io/openapiprocessor/core/converter
test/kotlin/io/openapiprocessor/core/converter
3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ class ApiOptions {
51
51
*/
52
52
var modelType = " default"
53
53
54
+ /* *
55
+ * enum type. default|string|framework.
56
+ */
57
+ var enumType = " default"
58
+
54
59
/* *
55
60
* suffix for model class names and enum names. Default is none, i.e. an empty string.
56
61
*/
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ class OptionsConverter(private val checkObsoleteProcessorOptions: Boolean = fals
57
57
is MappingV2 -> {
58
58
options.packageName = mapping.options.packageName
59
59
options.modelType = mapping.options.modelType
60
+ options.enumType = mapping.options.enumType
60
61
options.modelNameSuffix = mapping.options.modelNameSuffix
61
62
62
63
val (enable, format) = checkBeanValidation(mapping.options)
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ class OptionsConverterSpec: StringSpec({
23
23
options.beanValidation shouldBe false
24
24
options.javadoc shouldBe false
25
25
options.modelType shouldBe " default"
26
+ options.enumType shouldBe " default"
26
27
options.modelNameSuffix shouldBe String .Empty
27
28
options.typeMappings shouldHaveSize 0
28
29
options.formatCode.shouldBeFalse()
@@ -94,6 +95,8 @@ class OptionsConverterSpec: StringSpec({
94
95
options:
95
96
package-name: generated
96
97
model-name-suffix: Suffix
98
+ model-type: record
99
+ enum-type: string
97
100
bean-validation: true
98
101
javadoc: true
99
102
format-code: false
@@ -102,6 +105,8 @@ class OptionsConverterSpec: StringSpec({
102
105
103
106
options.packageName shouldBe " generated"
104
107
options.modelNameSuffix shouldBe " Suffix"
108
+ options.modelType shouldBe " record"
109
+ options.enumType shouldBe " string"
105
110
options.beanValidation shouldBe true
106
111
options.javadoc shouldBe true
107
112
options.formatCode.shouldBeFalse()
You can’t perform that action at this time.
0 commit comments