Class RequestBodyMethodArgumentResolver
java.lang.Object
org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
org.springframework.web.reactive.result.method.annotation.AbstractMessageReaderArgumentResolver
org.springframework.web.reactive.result.method.annotation.RequestBodyMethodArgumentResolver
- All Implemented Interfaces:
HandlerMethodArgumentResolver
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 @jakarta.validation.Valid
or
Validated
. Validation
failure results in an ServerWebInputException
.
- Since:
- 5.2
- Author:
- Sebastien Deleuze, Stephane Maldini, Rossen Stoyanchev
-
Field Summary
Fields inherited from class org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
logger
-
Constructor Summary
ConstructorDescriptionRequestBodyMethodArgumentResolver
(List<HttpMessageReader<?>> readers, ReactiveAdapterRegistry registry) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Object>
resolveArgument
(MethodParameter param, BindingContext bindingContext, ServerWebExchange exchange) Resolve the value for the method parameter.boolean
supportsParameter
(MethodParameter parameter) Whether this resolver supports the given method parameter.Methods inherited from class org.springframework.web.reactive.result.method.annotation.AbstractMessageReaderArgumentResolver
getMessageReaders, readBody, readBody
Methods inherited from class org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
checkAnnotatedParamNoReactiveWrapper, checkParameterType, checkParameterTypeNoReactiveWrapper, getAdapterRegistry
-
Constructor Details
-
RequestBodyMethodArgumentResolver
public RequestBodyMethodArgumentResolver(List<HttpMessageReader<?>> readers, ReactiveAdapterRegistry registry)
-
-
Method Details
-
supportsParameter
Description copied from interface:HandlerMethodArgumentResolver
Whether this resolver supports the given method parameter.- Parameters:
parameter
- the method parameter
-
resolveArgument
public reactor.core.publisher.Mono<Object> resolveArgument(MethodParameter param, BindingContext bindingContext, ServerWebExchange exchange) Description copied from interface:HandlerMethodArgumentResolver
Resolve the value for the method parameter.- Parameters:
param
- the method parameterbindingContext
- the binding context to useexchange
- the current exchange- Returns:
Mono
for the argument value, possibly empty
-