High Api

Use RESTful conventions

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

Rails Standards
36 rules • 1 standard
View
Django Best Practices
36 rules • 1 standard
View
FastAPI Guidelines
36 rules • 1 standard
View
Express Standards
31 rules • 1 standard
View
Spring Boot Standards
24 rules • 2 standards
View
Code Review Standards
58 rules • 0 standards
View

Add This Rule

Sign in to add this rule to your workspace

Sign in with GitHub

Details

Severity
High
Category
Api
Used in
6 rulesets