Skip to content

Allow ordering of HttpMessageConverterss through WebMvcConfigurer.configureMessageConverters(HttpMessageConverters.Builder) #35177

@mp911de

Description

@mp911de

The newly introduced WebMvcConfigurer.configureMessageConverters(HttpMessageConverters.Builder) hook should allow ordering message converters to contribute converters that are used before core (built-in) converters. This was previously possible through the List-based variant configureMessageConverters(List<HttpMessageConverter<?>>) by adding converters using add(index, …).

A use-case is Spring Data's ProjectingJackson2HttpMessageConverter that is able to create JSON projections using annotated interfaces but is not suitable to write payloads to JSON, hence replacing a potentially existing MappingJackson2HttpMessageConverter/JacksonJsonHttpMessageConverter is not an option.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions