Skip to content

[BUG][SPRING] Reactive paramter ServerWebExchange's properties appear in Swagger-UI #8031

@stephanpelikan

Description

@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:

ServerWebExchange

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

#4273

openapi-generator version

4.3.1 and 5.0

Suggest a fix

Add annotation @ApiIgnore to the parameter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions