-
Notifications
You must be signed in to change notification settings - Fork 37.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refine RouterFunctionMapping
ordering consistency
#30278
Comments
We are going to change, as of Spring Framework 6.1, the order of It also makes sense from a user perspective since functional routes are kind of lower level than annotation-based ones, and the overhead will be minimal for pure annotation-based use cases because if there are no |
This commit changes the order of RouterFunctionMapping defined in WebMvcConfigurationSupport from 3 to -1 in order to achieve better consistency between WebMVC and WebFlux. It also reduces the surprise factor. That way, functional routes are always before annotation-based ones. Closes spring-projectsgh-30278
Prior to this commit, the GraphQL WebSocket HandlerMapping bean would be ordered at position "2", before the RouterFunction variant defined by Spring Framework at position "3". Since then, the Spring Framework team changed the default order value for this one at "-1", see spring-projects/spring-framework#30278. This prevents the WebSocket upgrade, as the request is handled by the RouterFunction instead of the WebSocket handler. This commit updates the handlermapping order and introduces a test to prevent issues in the future. Fixes gh-37892
Related to spring-projects/spring-boot#34846, it would be great to refine if possible the relative ordering between
RouterFunctionMapping
and other mapping to have a better consistency between Spring WebFlux (whereRouterFunctionMapping
is beforeRequestMappingHandlerMapping
) and Spring MVC (where this is the other way around).The text was updated successfully, but these errors were encountered: