You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that as a result of #11105, my custom WebMvcConfigurer.configureContentNegotiation(ContentNegotiationConfigurer configurer) changes were being overwritten by the defaults from WebMvcProperties. Regardless of the @Order value given, WebMvcAutoConfiguration.configureContentNegotiation(ContentNegotiationConfigurer configurer) always seems to happen after the user configurer.
This means the only way to configure the content negotiation is through the property files.
In 1.5, I was calling configurer.favorParameter(true), but this gets overwritten by the default property, false, in 2.0.
@bclozel mentioned in #11105 that this appears to be a general ordering problem with WebMvcConfigurer, hence raising this issue.
The text was updated successfully, but these errors were encountered:
In WebMvcAutoConfiguration, Spring Boot provides a WebMvcAutoConfigurationAdapter (unordered). If developers provide their own WebMvcConfigurer, both are unordered, so Ordered.LOWEST_PRECEDENCE.
The developer's one is processed first (contributed by the application configuration) while the auto-configuration one is processed after (contributed during the auto-configuration phase), overwriting all choices made by the first one.
We should order the auto-configuration configurer at 0, so that:
by default, developer's configuration will run after and enforce their opinion
we give enough room for developers to run things before if they want to
I noticed that as a result of #11105, my custom
WebMvcConfigurer.configureContentNegotiation(ContentNegotiationConfigurer configurer)
changes were being overwritten by the defaults fromWebMvcProperties
. Regardless of the@Order
value given,WebMvcAutoConfiguration.configureContentNegotiation(ContentNegotiationConfigurer configurer)
always seems to happen after the user configurer.This means the only way to configure the content negotiation is through the property files.
In 1.5, I was calling configurer.favorParameter(true), but this gets overwritten by the default property, false, in 2.0.
@bclozel mentioned in #11105 that this appears to be a general ordering problem with
WebMvcConfigurer
, hence raising this issue.The text was updated successfully, but these errors were encountered: