File tree 4 files changed +10
-0
lines changed
openapi-processor-core/src
main/kotlin/io/openapiprocessor/core
test/kotlin/io/openapiprocessor/core/converter 4 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class ApiOptions: MappingSettings {
34
34
* - models => "${packageName}.model"
35
35
*/
36
36
var packageName = " io.openapiprocessor.generated"
37
+ var packageNameFromPath = false
37
38
38
39
var packageNameApi : String = " api"
39
40
var packageNameModel: String = " model"
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ class OptionsConverter(private val checkObsoleteProcessorOptions: Boolean = fals
65
65
}
66
66
67
67
options.packageName = mapping.options.packageName
68
+ options.packageNameFromPath = mapping.options.packageNameFromPath
68
69
options.modelType = mapping.options.modelType
69
70
options.modelAccessors = mapping.options.modelAccessors
70
71
options.enumType = mapping.options.enumType
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ data class Options(
22
22
*/
23
23
val packageName : String = " io.openapiprocessor.generated" ,
24
24
25
+ /* *
26
+ * enable/disable location based package names (optional)
27
+ */
28
+ val packageNameFromPath : Boolean = false ,
29
+
25
30
/* *
26
31
* enable/disable clearing of targetDir (optional).
27
32
*/
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ class OptionsConverterSpec: StringSpec({
28
28
options.targetDirOptions.layout shouldBe TargetDirLayout .CLASSIC
29
29
30
30
options.packageName shouldBe " io.openapiprocessor.generated"
31
+ options.packageNameFromPath shouldBe false
31
32
options.beanValidation shouldBe false
32
33
options.javadoc shouldBe false
33
34
options.modelType shouldBe " default"
@@ -109,6 +110,7 @@ class OptionsConverterSpec: StringSpec({
109
110
target-dir:
110
111
layout: standard
111
112
package-name: generated
113
+ package-name-from-path: true
112
114
model-name-suffix: Suffix
113
115
model-type: record
114
116
model-accessors: false
@@ -130,6 +132,7 @@ class OptionsConverterSpec: StringSpec({
130
132
options.targetDirOptions.clear.shouldBeFalse()
131
133
options.targetDirOptions.layout.isStandard().shouldBeTrue()
132
134
options.packageName shouldBe " generated"
135
+ options.packageNameFromPath shouldBe true
133
136
options.modelNameSuffix shouldBe " Suffix"
134
137
options.modelType shouldBe " record"
135
138
options.modelAccessors shouldBe false
You can’t perform that action at this time.
0 commit comments