@@ -17,9 +17,11 @@ import io.openapiprocessor.core.parser.HttpMethod
1717import io.openapiprocessor.core.parser.NullSchema
1818import io.openapiprocessor.core.parser.RequestBody
1919import io.openapiprocessor.core.parser.Response
20+ import io.openapiprocessor.core.processor.mapping.v2.ResultStyle
2021import io.openapiprocessor.core.writer.Identifier
2122import org.slf4j.Logger
2223import org.slf4j.LoggerFactory
24+ import kotlin.collections.mutableMapOf
2325import io.openapiprocessor.core.model.RequestBody as ModelRequestBody
2426import io.openapiprocessor.core.model.Response as ModelResponse
2527import io.openapiprocessor.core.model.parameters.Parameter as ModelParameter
@@ -218,7 +220,13 @@ class ApiConverter(
218220 private fun collectResponses (operation : Operation , ctx : ConverterContext ): Map <String , List <ModelResponse >> {
219221 val responses: MutableMap <String , List <ModelResponse >> = mutableMapOf ()
220222
221- operation.getResponses().forEach { (httpStatus, httpResponse) ->
223+ val opResponses = operation.getResponses()
224+
225+ val resultStyle = getResultStyle(ctx.path, operation.getMethod())
226+ val responseCollector = ContentTypeResponseCollector (opResponses, resultStyle)
227+ val interfaceCollector = ContentTypeInterfaceCollector (ctx.path, operation.getMethod(), responseCollector)
228+
229+ opResponses.forEach { (httpStatus, httpResponse) ->
222230 val results = createResponses(
223231 operation,
224232 httpStatus,
@@ -386,6 +394,10 @@ class ApiConverter(
386394 return mappingFinder.isEndpointExcluded(MappingFinderQuery (path, method))
387395 }
388396
397+ private fun getResultStyle (path : String , method : HttpMethod ): ResultStyle {
398+ return mappingFinder.findResultStyleMapping(MappingFinderQuery (path, method))
399+ }
400+
389401 private fun getInterfaceName (op : Operation , excluded : Boolean ): String {
390402 var targetInterfaceName = INTERFACE_DEFAULT_NAME
391403
0 commit comments