Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/esotericman/spring-method-parameter-resolver
Enhanced spring parameter binding extensions for spring 5.x and 6.x
https://github.com/esotericman/spring-method-parameter-resolver
data-bind request-param spring spring-boot
Last synced: about 1 month ago
JSON representation
Enhanced spring parameter binding extensions for spring 5.x and 6.x
- Host: GitHub
- URL: https://github.com/esotericman/spring-method-parameter-resolver
- Owner: esotericman
- License: apache-2.0
- Created: 2024-06-01T02:03:49.000Z (6 months ago)
- Default Branch: spring6
- Last Pushed: 2024-06-10T01:24:07.000Z (5 months ago)
- Last Synced: 2024-06-10T14:52:09.511Z (5 months ago)
- Topics: data-bind, request-param, spring, spring-boot
- Language: Java
- Homepage:
- Size: 157 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![GitHub](https://img.shields.io/github/license/Flmelody/spring-method-parameter-resolver)
## Instruction
[简体中文](README.zh-CN.md)
This package can help you implement Spring parameter custom binding , such as automatic conversion of parameter names ,
currently provides RequestParam enhancements.## Choose correct version
This project contains two versions, one for Spring5 and another for Spring6.
For Spring5 you should use```groovy kotlin
implementation("org.flmelody:spring-method-parameter-resolver:x.y.z-spring5")
```For Spring6
```groovy kotlin
implementation("org.flmelody:spring-method-parameter-resolver:x.y.z-spring6")
```## SpringBoot quick start
- enable resolver, add this `@EnableWebResolver(paramNamingStrategy = NamingStrategy.SNAKE_CASE) `in
any `@Configuration` class, for example
![img.png](img.png)
- use `@WebParam` to replace Spring `@RequestParam`
Now, your request parameter can accept snake-case parameter name## Build your own namingStrategyHandler
- implement `NamingStrategyHandler`
- register your naming-strategy handler into bean factory## Build your own methodArgumentResolver
- implement `WebMethodArgumentResolver`
- register your argument resolver into bean factory