File tree 1 file changed +8
-2
lines changed
openapi-processor-core/src/main/kotlin/io/openapiprocessor/core/writer/java 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -129,11 +129,17 @@ class InterfaceWriter(
129
129
130
130
private fun addImports (endpoint : Endpoint , response : EndpointResponse , imports : MutableSet <String >) {
131
131
val mappingFinder = MappingFinder (apiOptions)
132
- val resultStyle = mappingFinder.findResultStyleMapping(MappingFinderQuery (endpoint))
133
- val responseImports: MutableSet <String > = response.getResponseImports(resultStyle).toMutableSet()
132
+ val query = MappingFinderQuery (endpoint)
133
+ val resultStyle = mappingFinder.findResultStyleMapping(query)
134
+ val resultStatus = mappingFinder.getResultStatusOption(query)
134
135
136
+ val responseImports: MutableSet <String > = response.getResponseImports(resultStyle).toMutableSet()
135
137
if (responseImports.isNotEmpty()) {
136
138
imports.addAll(responseImports)
137
139
}
140
+
141
+ if (resultStatus && response.hasSingleResponse(resultStyle)) {
142
+ imports.addAll(annotations.getAnnotation(response).imports)
143
+ }
138
144
}
139
145
}
You can’t perform that action at this time.
0 commit comments