org.springframework.web.reactive.result.method.annotation

Class RequestBodyArgumentResolver

  • All Implemented Interfaces:
    HandlerMethodArgumentResolver


    public class RequestBodyArgumentResolver
    extends AbstractMessageReaderArgumentResolver
    Resolves method arguments annotated with @RequestBody by reading the body of the request through a compatible HttpMessageReader.

    An @RequestBody method argument is also validated if it is annotated with @javax.validation.Valid or Validated. Validation failure results in an ServerWebInputException.

    Since:
    5.0
    Author:
    Sebastien Deleuze, Stephane Maldini, Rossen Stoyanchev
    • Method Detail

      • supportsParameter

        public boolean supportsParameter(MethodParameter parameter)
        Description copied from interface: HandlerMethodArgumentResolver
        Whether this resolver supports the given method parameter.
        Parameters:
        parameter - the method parameter
      • resolveArgument

        public reactor.core.publisher.Mono<java.lang.Object> resolveArgument(MethodParameter param,
                                                                             BindingContext bindingContext,
                                                                             ServerWebExchange exchange)
        Description copied from interface: HandlerMethodArgumentResolver
        Resolve the value for the method parameter.
        Parameters:
        param - the method parameter
        bindingContext - the binding context to use
        exchange - the current exchange
        Returns:
        Mono for the argument value, possibly empty