There must be a distinct filter applied to the produces and consumes mappings since otherwise it generates the following structure:
@GetMapping(
path = "/destinations",
produces = {
"application/json",
"application/json",
"application/json",
"application/json"
})
ResponseEntity<?> getAllDestinations();
from this yaml:
paths:
'/destinations':
get:
responses:
'200':
description: OK
content:
application/json:
schema:
'$ref': '#/components/schemas/GetAllDestinationsResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
Fix:
mapping += consumes.map {
quote(it)
}.distinct().joinToString(", ")
mapping += produces.map {
quote(it)
}.distinct().joinToString(", ")
There must be a distinct filter applied to the produces and consumes mappings since otherwise it generates the following structure:
from this yaml:
Fix:
openapi-processor-spring/src/main/kotlin/io/openapiprocessor/spring/writer/java/MappingAnnotationWriter.kt
Line 46 in b6cc315
openapi-processor-spring/src/main/kotlin/io/openapiprocessor/spring/writer/java/MappingAnnotationWriter.kt
Line 57 in b6cc315