← ClaudeAtlas

api-designlisted

REST API design patterns — resource modeling, HTTP methods, status codes, pagination, RFC 9457 errors, OpenAPI documentation, versioning. Use when user asks about API design, endpoints, error handling, or documentation.
IuliaIvanaPatras/claude-code-templates · ★ 0 · AI & Automation · score 65
Install: claude install-skill IuliaIvanaPatras/claude-code-templates
# API Design Skill REST API design patterns for Spring Boot 4 with RFC 9457 error handling and OpenAPI documentation. ## When to Use - "design API" / "create endpoints" / "REST conventions" - "error handling" / "validation errors" / "problem details" - "API documentation" / "OpenAPI" / "Swagger" - Before creating a new controller or modifying API contracts --- ## Quick Reference: HTTP Methods | Method | Use Case | Idempotent | Request Body | Response | |--------|----------|------------|-------------|----------| | GET | Read resource(s) | Yes | No | 200 OK | | POST | Create resource | No | Yes | 201 Created | | PUT | Full replace | Yes | Yes | 200 OK | | PATCH | Partial update | No | Yes | 200 OK | | DELETE | Remove resource | Yes | No | 204 No Content | --- ## Resource URL Design ``` # Collections GET /api/v1/users # List users (paginated) POST /api/v1/users # Create user # Single resource GET /api/v1/users/{id} # Get user PUT /api/v1/users/{id} # Replace user PATCH /api/v1/users/{id} # Update user fields DELETE /api/v1/users/{id} # Delete user # Sub-resources GET /api/v1/users/{id}/orders # List user's orders POST /api/v1/users/{id}/orders # Create order for user # Actions (non-CRUD) POST /api/v1/users/{id}/activate # Custom action POST /api/v1/orders/{id}/cancel # Custom action # Filtering, sorting, pagination GET /api/v1/users?role=ADMIN&sort=name,asc&page=0&size=20 `