(global) Single & Multi mapping

this is experimental

single & multi wrapper

When using WebFlux we like to wrap certain parameters & results types in reactive types like Mono<> or Flux<>.

To achieve this the processor knows two special mappings:

  • single: to wrap non-array like types (i.e. not a collection)

  • multi: to wrap array like types (i.e. a collection)


  multi: reactor.core.publisher.Flux

Which will use Flux<> as collection wrapper instead of the original java collection type for all list responses (or parameters). multi does not affect collections in model types.


To map non-array like responses to a Mono<> set the single mapping:

 single: reactor.core.publisher.Mono

The processor will now wrap all non-array like response types with the given single mapping.

single & multi with result mapping

It is possible to use single & multi mappings together with the result mapping, i.e. ResponseEntity.

result will wrap single


and multi