For the URI/PathVariable (Message) name:
Spring 4.2+ supports configuration of case-insensitive path matching.
You can configure it as follows:
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
AntPathMatcher matcher = new AntPathMatcher();
matcher.setCaseSensitive(false);
configurer.setPathMatcher(matcher);
}
}
For the @RequestParam
/request parameters (ID) part:
You have to do it manually - there's no support in Spring Boot for this out of the box. The base concept is that you have to implement a custom servlet filter, which standardizes the params in HttpServletRequest
- e.g. you can apply to all of them String.toLowerCase()
before passing them down to your @RestController
, where you have all the request parameter binding defined as lower-cased values.