Skip to content

Allow generation of reactive APIs w/o wrapping Mono<ResponseEntity> #1309

@jrobison153

Description

@jrobison153
Description

We've been looking at the generated Spring Web Reactive interfaces and the response type wrappings seem superfluous, this is using version openapi-generator:3.3.1. For an API that returns a collection of type T, we get a Java interface with the following response signature

Mono<ResponseEntity<Flux<T>>>

From all of our testing this behaves identically to Flux<T> from a reactive client's perspective. The additional Mono<ResponseEntity> adds additional code to each controller to add the type wrappings.

Since the ServerWebExchange is already present and gives all the control over the HTTP session needed. It seems the generated code could be simplified

The suggestion is that an option could be added to generate the reactive interfaces w/o the wrapping Mono<ResponseEntity>

openapi-generator version

openapi-generator:3.3.1

Related issues/PRs

#571

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions