Description
If multiple response bodies are specified, the producer annotation is filled incorrectly and a spring boot application cannot be started.
openapi-generator version
4.3.1 and 5.0.1
OpenAPI declaration file content or url
/foo:
post:
operationId: createFoo
...
responses:
'200':
description: "Return"
content:
text/plain:
schema:
type: string
text/html:
schema:
type: string
Generated java code
@RequestMapping(produces = "text/plain,text/html")
public ResponseEntity<Void> createFoo(...) {...}
Generation Details
Maven plugin
<configuration>
<generatorName>spring</generatorName>
<configOptions>
<sortParamsByRequiredFlag>true</sortParamsByRequiredFlag>
<library>spring-cloud</library>
<java8>true</java8>
<dateLibrary>java8</dateLibrary>
<useOptional>true</useOptional>
<skipDefaultInterface>true</skipDefaultInterface>
<useBeanValidation>true</useBeanValidation>
</configOptions>
Steps to reproduce
Use multiple response bodies:
Expected code is not a comma separated String. Spring needs a proper list of producers
@RequestMapping(produces = {"text/plain","text/html"})
public ResponseEntity<Void> createFoo(...) {...}
see https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/bind/annotation/RequestMapping.html#produces--
Description
If multiple response bodies are specified, the producer annotation is filled incorrectly and a spring boot application cannot be started.
openapi-generator version
4.3.1 and 5.0.1
OpenAPI declaration file content or url
Generated java code
Generation Details
Maven plugin
Steps to reproduce
Use multiple response bodies:
Expected code is not a comma separated String. Spring needs a proper list of producers
see https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/bind/annotation/RequestMapping.html#produces--