[BUG][SPRING] Reactive paramter ServerWebExchange's properties appear in Swagger-UI
Created by: stephanpelikan
Description
Building a reactive Spring service adds an additional Java parameter ServerWebExchange exchange
which brings a long list of additional input parameters in the Swagger-UI:
Generation Details
pom.xml:
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
...
<executions>
<execution>
...
<configuration>
<generatorName>spring</generatorName>
...
<configOptions>
...
<reactive>true</reactive>
...
</configOptions>
Actual output:
default Mono<ResponseEntity<Void>> doSomething(
@ApiParam(value = "" ,required=true ) @Valid @RequestBody Mono<Whatever> whatever,
ServerWebExchange exchange) {
Expected output:
default Mono<ResponseEntity<Void>> doSomething(
@ApiParam(value = "" ,required=true ) @Valid @RequestBody Mono<Whatever> whatever,
@ApiIgnore ServerWebExchange exchange) {
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/issues/4273
openapi-generator version
4.3.1 and 5.0
Suggest a fix
Add annotation @ApiIgnore
to the parameter.