API Design Safety & Best Practices
Enforces robust REST API response structures and prevents common design pitfalls during development and downstream data generation.
This skill provides a comprehensive set of guidelines and automated checks to ensure REST API responses are consistent, type-safe, and user-friendly. It helps developers avoid subtle bugs like Java generic method ambiguity, inconsistent null handling, and the common mistake of using HTTP 500 for business logic failures. Beyond standard API design, it enforces strict multi-layer validation for downstream artifacts like Excel, CSV, and PDF exports to prevent silent data corruption or rejection by third-party systems such as payment gateways and accounting platforms.
Key Features
01Standardizes 'code', 'message', and 'data' field usage across API responses
02772 GitHub stars
03Prevents Java generic method overloading ambiguity for API response types
04Enforces consistent handling of null objects, empty lists, and paginated data
05Separates transport-layer HTTP status codes from application-layer business codes
06Implements strict pre-validation for critical fields in file exports (Excel/PDF/CSV)
Use Cases
01Refactoring legacy API response structures to follow modern, consistent industry standards
02Developing reliable file export features that require strict field integrity for third-party consumers
03Designing global exception handlers that distinguish between business errors and system failures