(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

map:
  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.

single

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

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

ResponseEntity<Mono<String>>

and multi

ResponseEntity<Flux<String>>