Q:

WebFlux RestController parameter handling

I'm using WebFlux to create a REST controller. My question is, how do I handle request parameters/request body? Can I pass them like the old way and remain reactive?
@PostMapping("/register")
Mono<User> register(@Valid @RequestBody UserRegistrationDto userRegistrationDto) {
    return userService.registerUser(userRegistrationDto);
}

Or do I need to read the UserRegistrationDto from org.springframework.web.reactive.function.server.ServerRequest and do the validation manually? Maybe my method should accept Mono<UserRegistrationDto>?

A:

You have a choice, if you prefer the 'old' way of RestControllers then the way you posted is just fine. If you prefer the new way of handlers and routes then you would need a serverRequest.bodyToMono as you stated. 

