Java REST API Design Principles
Apply REST API design principles for Spring Boot applications.
What is covered in this Skill?
- HTTP methods (GET, POST, PUT, PATCH, DELETE)
- Resource URI design
- HTTP status codes
- Request/response DTOs
- API versioning
- Error handling
- API security
- Documentation (OpenAPI)
- Controller advice and problem details
Scope: Apply recommendations based on the reference rules and good/bad code examples.
Constraints
Before applying any REST API changes, ensure the project compiles. If compilation fails, stop immediately. After applying improvements, run full verification.
- MANDATORY: Run
./mvnw compileormvn compilebefore applying any change - SAFETY: If compilation fails, stop immediately
- VERIFY: Run
./mvnw clean verifyormvn clean verifyafter applying improvements - BEFORE APPLYING: Read the reference for detailed rules and good/bad patterns
When to use this skill
- Review Java code for Spring Boot REST API
- Apply best practices for Spring Boot REST API in Java code
Reference
For detailed guidance, examples, and constraints, see references/302-frameworks-spring-boot-rest.md.