public class RequestBodyArgumentResolver extends AbstractMessageReaderArgumentResolver
@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
.
Constructor and Description |
---|
RequestBodyArgumentResolver(java.util.List<HttpMessageReader<?>> readers,
ReactiveAdapterRegistry registry) |
Modifier and Type | Method and Description |
---|---|
<any> |
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.
|
getMessageReaders, readBody
checkAnnotatedParamNoReactiveWrapper, checkParameterType, checkParameterTypeNoReactiveWrapper, getAdapterRegistry
public RequestBodyArgumentResolver(java.util.List<HttpMessageReader<?>> readers, ReactiveAdapterRegistry registry)
public boolean supportsParameter(MethodParameter parameter)
HandlerMethodArgumentResolver
parameter
- the method parameterpublic <any> resolveArgument(MethodParameter param, BindingContext bindingContext, ServerWebExchange exchange)
HandlerMethodArgumentResolver
param
- the method parameterbindingContext
- the binding context to useexchange
- the current exchangeMono
for the argument value, possibly empty