File tree 2 files changed +10
-2
lines changed
openapi-processor-core/src
main/kotlin/io/openapiprocessor/core/writer/java
testInt/kotlin/io/openapiprocessor/core
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ import io.openapiprocessor.core.writer.*
15
15
import java.io.StringWriter
16
16
import java.io.Writer
17
17
18
+ typealias AdditionalWriter = (ApiOptions , SourceFormatter , WriterFactory ) -> Unit
19
+
18
20
/* *
19
21
* Root writer for the generated api files.
20
22
*/
@@ -26,6 +28,7 @@ class ApiWriter(
26
28
private val dataTypeWriter : DataTypeWriter ,
27
29
private val enumWriter : StringEnumWriter ,
28
30
private val interfaceDataTypeWriter : InterfaceDataTypeWriter ,
31
+ private val additionalWriter : List <AdditionalWriter > = emptyList(),
29
32
private val formatter : SourceFormatter = GoogleFormatter (),
30
33
private val writerFactory : WriterFactory = DefaultWriterFactory (options)
31
34
) {
@@ -42,6 +45,7 @@ class ApiWriter(
42
45
writeObjectDataTypes(api)
43
46
writeInterfaceDataTypes(api)
44
47
writeEnumDataTypes(api)
48
+ writeAdditionalFiles()
45
49
}
46
50
47
51
private fun writeGenerated () {
Original file line number Diff line number Diff line change @@ -46,13 +46,15 @@ class TestProcessor:
46
46
)
47
47
48
48
val generatedWriter = GeneratedWriterImpl (generatedInfo, options)
49
+ val validationWriter = ValidationWriter (options)
49
50
val beanValidation = BeanValidationFactory (options)
50
51
val javaDocWriter = JavaDocWriter ()
52
+ val formatter = GoogleFormatter ()
51
53
52
54
val writer = ApiWriter (
53
55
options,
54
56
generatedWriter,
55
- ValidationWriter (options) ,
57
+ validationWriter ,
56
58
InterfaceWriter (
57
59
options,
58
60
generatedWriter,
@@ -86,7 +88,9 @@ class TestProcessor:
86
88
options,
87
89
generatedWriter,
88
90
javaDocWriter
89
- )
91
+ ),
92
+ listOf (),
93
+ formatter
90
94
)
91
95
92
96
writer.write(api)
You can’t perform that action at this time.
0 commit comments