High
Api
Use RESTful conventions
Official
Rule Description
Follow REST conventions for predictable APIs:
- GET /resources - List all
- GET /resources/:id - Show one
- POST /resources - Create
- PUT/PATCH /resources/:id - Update
- DELETE /resources/:id - Destroy
Use nested routes for relationships:
- GET /users/:user_id/orders - User's orders
- POST /orders/:order_id/items - Add item to order
Return appropriate HTTP status codes:
- 200 OK, 201 Created, 204 No Content
- 400 Bad Request, 401 Unauthorized, 404 Not Found
- 500 Internal Server Error
Included in Rulesets
Add This Rule
Sign in to add this rule to your workspace
Sign in with GitHubDetails
- Severity
- High
- Category
- Api
- Used in
- 6 rulesets