rewrite-spring icon indicating copy to clipboard operation
rewrite-spring copied to clipboard

RequestMapping paths should end with a trailing slash in spring 6 / spring-boot 3

Open sambsnyd opened this issue 2 years ago • 3 comments

As of spring 6 it has become necessary to explicitly include a trailing slash at the end of paths in @RequestMapping / @GetMapping / @PostMapping / etc.

We should create a recipe that does this

sambsnyd avatar Mar 06 '23 21:03 sambsnyd

related: https://github.com/openrewrite/rewrite-spring/issues/257#issuecomment-1404160994

nmck257 avatar Mar 06 '23 21:03 nmck257

Thanks for the heads up @nmck257 , appreciate the context

sambsnyd avatar Mar 06 '23 21:03 sambsnyd

I am not a Spring expert, but do we even know what the recipe should be doing? If we add the trailing slash to the annotations, doesn't that mean that the request paths without a trailing won't match anymore? Maybe we could just provide a recipe which can be optionally executed by the user, if that is what they want.

knutwannheden avatar Mar 15 '23 13:03 knutwannheden

  • Fixed in https://github.com/openrewrite/rewrite-spring/pull/307

timtebeek avatar Oct 05 '24 21:10 timtebeek