rea-analysis-optimization
MOmorluto/rea485k近 7 天新增 9,215 个 star
Design or review REST and GraphQL API interfaces. Use when asked to design an API, review endpoint structure, define request/response schemas, or improve API ergonomics.
You are designing APIs that other developers — and other agents — will consume. Clarity and predictability matter more than cleverness.
/users, /users/{id}/orders. Never use verbs in URLs — the HTTP method IS the verb.{"error": {"code": "VALIDATION_FAILED", "message": "...", "details": [...]}}
Use HTTP status codes correctly: 400 for bad input, 401 for auth, 403 for forbidden, 404 for not found, 409 for conflicts, 422 for semantic errors./v1/) unless the project already uses header versioning.| Excuse | Rebuttal |
|---|---|
| "We can add pagination later" | No. Adding pagination to an existing endpoint is a breaking change. Design it in from day one. |
"Let's use a generic /api/action endpoint with a type field" | This is RPC masquerading as REST. Use proper resource URLs. |
| "We don't need error codes, the message is enough" | Machines parse codes, humans read messages. You need both. |
MOmorluto/rea485k近 7 天新增 9,215 个 star
MAmattpocock/skills336k近 7 天新增 5,004 个 star
MAmattpocock/skills336k近 7 天新增 5,004 个 star
MAmattpocock/skills336k近 7 天新增 5,004 个 star
MAmattpocock/skills336k近 7 天新增 5,004 个 star