Skip to content

MappingJacksonHttpMessageConverter's ObjectMapper does not use ConversionService when binding JSON to JavaBean properties [SPR-6731] #11397

Closed
@spring-projects-issues

Description

@spring-projects-issues

Keith Donald opened SPR-6731 and commented

Noticed when using @RequestBody to bind an incoming JSON string to an Account JavaBean. I was expecting the binding process to respect format annotations such as @NumberFormat and @DateTimeFormat during string-to-propertyType conversion. However, this did not happen since it appears the MappingJacksonHttpMessageConverter is using the default Jackson ObjectMapper by default. For consistency, we should consider configuring Jackson to work with the ConversionService during its mapping process. This would allow format annotations like @NumberFormat and @DateTimeFormat to be respected.


Affects: 3.0 GA

Issue Links:

13 votes, 20 watchers

Metadata

Metadata

Assignees

Labels

has: votes-jiraIssues migrated from JIRA with more than 10 votes at the time of importin: webIssues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions