Skip to content

resolveRequestBody algorithm does not take into account ConversionService when determining if binding is possible [SPR-6729] #11395

Closed
@spring-projects-issues

Description

@spring-projects-issues

Keith Donald opened SPR-6729 and commented

I noticed this when using @RequestBody on an Account JavaBean @Controller parameter, when the ContentType of my POST /accounts request was "application/x-www-form-urlencoded". In this case, the resolved FormHttpMessageConverter is only capable of reading a MultiValueMap, not an Account, so I get a 415 back due to a HttpMediaTypeNotSupportedException. However, the ConversionService configured with Spring MVC may be capable of mapping a MultiValueMap to a JavaBean, but it is never queried inside resolveRequestBody of AnnotationMethodHandlerAdapter. If the ConversionService is capable of such a mapping, should it be invoked to allow the Account binding to succeed? Or should it be the sole responsibility of the MessageConverter to determine if binding is possible?


Affects: 3.0 GA

Issue Links:

1 votes, 1 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions