Spring boot api design
Skill ComeOnOliver/skillshub/skills/HoangNguyen0403/agent-skills-standard/spring-boot-api-design
Standards for OpenAPI, Versioning, and Global Error Handling. Use when designing Spring Boot APIs with OpenAPI specs, versioning, or global error handling. (triggers: **/*Controller.java, openapi, swagger, versioning, problemdetails)From its SKILL.md
npx -y skills add ComeOnOliver/skillshub --skill spring-boot-api-designAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.2 KB, 233 tokens by cl100k_base, as published. Nobody here has run it
Spring Boot API Design Standards
Priority: P0
Implementation Guidelines
OpenAPI (Swagger)
- SpringDoc: Use
springdoc-openapi-starter-webmvc-ui. - Annotations: Use
@Operationand@ApiResponse. Keep clean. - Schema: Define examples in
@Schemaon DTOs.
API Versioning
- Strategy: Prefer URI Versioning (
/api/v1/) for caching simplicity. - Deprecation: Use
@Deprecated+ OpenAPI flag.
Error Handling (RFC 7807)
- ProblemDetails: Enable
spring.mvc.problem-details.enabled=true. - Extension: Extend
ProblemDetailwith custom fields if needed. - Security: NEVER expose stack traces in API errors.
Anti-Patterns
- No Map<K,V> responses: Return typed DTO records instead.
- No Header Versioning: Use URI versioning; headers are hard to test/cache.
- No hidden APIs: Document all endpoints with Swagger/OpenAPI.
References
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.