When to use
Use this skill when implementing endpoints, request/response DTOs, validation, or exception handling.
Recommended patterns
- •Controllers:
- •
@RestController,@RequestMapping("/orders") - •Separate DTOs from entities (request/response models)
- •
- •Validation:
- •Use
@Validand Jakarta annotations (@NotNull,@DecimalMin)
- •Use
- •Error handling:
- •Centralized
@RestControllerAdvice - •Return stable JSON error contract
- •Centralized
- •Time:
- •Prefer
Instant/OffsetDateTimein domain and ISO-8601 in API
- •Prefer
Project-specific rules
- •API pagination is 1-based (
page), internally convert to 0-based for SpringPageRequest - •Enforce
limit <= 100 - •Filters must be optional and combinable
Commands
- •Run:
./gradlew bootRun - •Tests:
./gradlew test