This package can help you implement Spring parameter custom binding , such as automatic conversion of parameter names , currently provides RequestParam enhancements.
This project contains two versions, one for Spring5 and another for Spring6.
For Spring5 you should use
implementation("org.flmelody:spring-method-parameter-resolver:x.y.z-spring5")
For Spring6
implementation("org.flmelody:spring-method-parameter-resolver:x.y.z-spring6")
- enable resolver, add this
@EnableWebResolver(paramNamingStrategy = NamingStrategy.SNAKE_CASE)
in any@Configuration
class, for example - use
@WebParam
to replace Spring@RequestParam
Now, your request parameter can accept snake-case parameter name
- implement
NamingStrategyHandler
- register your naming-strategy handler into bean factory
- implement
WebMethodArgumentResolver
- register your argument resolver into bean factory