Open VladimirSvoboda opened 8 months ago
Does anybody know a workaround to this issue?
(just a comment: this issue also touches the older, still unresolved bug #10250: because Spring does the serialization for Flux<String>
in plaintext instead of JSON (explained in https://github.com/spring-projects/spring-framework/issues/20807), people wanting the response to be in JSON wish for Mono<List<String>>
as response data type instead) (however, this is another issue, and I understand if it will be handled separately)
Bug Report Checklist
Description
With the Spring generator, with reactive enabled and responseEntity disabled. The generated server code for operations returning array of elements must be
Flux<Item>
and notMono<Flux<Item>>
openapi-generator version
7.0.1
OpenAPI declaration file content or url
modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
Generation Details
Sample config file:
modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
Steps to reproduce
Generate and check the return type of the method
findPetsByStatus
Related issues/PRs
1309
Suggest a fix
Currently, the code assumes that
Mono
is the response wrapper to always use when reactive is enabled. This is false when data are arrays.