Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kimjuny/kotsu

🌶️ Spring-MVC parameter resolver extension
https://github.com/kimjuny/kotsu

spring spring-mvc spring-web

Last synced: about 2 months ago
JSON representation

🌶️ Spring-MVC parameter resolver extension

Awesome Lists containing this project

README

        

# Kotsu
A Spring Web MVC extension.

* Tired of modeling inputs for every request?

* Don't want to remember every specific parameter validation restrictions?

* Looking for a highly *flexible* & *reusable* & *customizable* replacement for Spring/Hibernate Validator?

This little but powerful Spring extention may bring you a lot help!

### Kotsu Components:

1. Extractor: Automatically extracts parameter according to "Content-Type" header.

2. Validator: Validates input parameter by simple strategies.

3. Assembler: Assemble and return the result.

Each components are reusable & customizable.

### Basic Usage:

```java
@RestController
@RequestMapping("/")
public class TestController {

@RequestMapping(value = "",method = RequestMethod.POST, produces = {MediaType.APPLICATION_JSON_VALUE})
public void api(@Absent(Mapper.PAGE_IDX) Optional pageIdx,
@Absent @VInteger(min = 0, max = 10) Optional pageMax,
@Required(Mapper.MODE) Long mode,
@Required @VString(min = 1, max = 32, regex = "*") String userName) {

}

}
```

### Requirements:

1. Java 8
2. Spring Web MVC or Spring Boot
3. Latest version of Kotsu
4. Configuration:

```xml








```

### Wiki

For a better knowledge of Kotsu usage and requirements please refer to [Kotsu-Wiki](https://github.com/ronankim/kotsu/wiki).