spring-rest-api-creator
Installation
SKILL.md
Spring REST APIs Creator
Instructions
The following are key principles to follow while creating Spring REST APIs:
- Make sure to create the recommended package structure for Spring Boot projects
- Use converters to bind
@PathVariableand@RequestParamto Value Objects - Use Jackson for
@RequestBodybinding to Request Objects with Value Object properties - Use
@JsonUnwrappedto map flattened JSON to nested objects - Validate with
@Validannotation - Return appropriate HTTP status codes
- Delegate to services for business logic execution
Converter for PathVariable/RequestParam Binding
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;