SKILL

rest-api-design

Design consistent REST APIs: resource modeling, status codes, pagination, versioning, error contracts, and documentation. Use for any API design task.

原文 · 译文尚未补齐

适用对象:设计与内容创作。自动收录 · 待核查。

原作者说明节选

从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。

查看英文原文

原文涵盖的主题

  • REST API Design
  • Quick Start
  • When to Use
  • Best Practices
  • Resources
  • Methods & Status
  • Pagination & Filtering
  • Versioning & Evolution

Designing consistent, evolvable REST APIs. Public or internal HTTP APIs Designing before implementation Versioning and evolving existing APIs SDKs and clients that consume the API Model nouns as resources, actions as sub-resources Use plural names: /users, not /user Nest only for genuine ownership: /users/{id}/orders Represent relations with IDs, not nested objects Use HTTP methods for intent (GET/POST/PUT/PATCH/DELETE) Return 201 with Location on create, 204 on delete Use 422 for validation, 409 for conflicts Map errors consistently: code, message, details Paginate list endpoints: page/limit or cursor Use cursor-based pagination for stability Filter with query params, not paths Sort with explicit sort param Version the API: URL prefix or header Additive changes within a version Deprecate with headers and clear notices Document everything in OpenAPI 1. Identify resources and their relations from the domain. 2. Define endpoints with proper methods and paths. 3. Specify request/response schemas and status codes. 4. Add pagination, filtering, and sorting to lists. 5. Create a consistent error contract. 6. Decide versioning strategy up front. 7. Write OpenAPI spec and validate it. 8. G

这里只展示节选,请以完整原文和当前要求为准。

来源仓库
ssrjkk/agent-skills
源文件
.claude/skills/backend/rest-api-design/SKILL.md
固定版本
868975614072b553f929cb32c52c5e7dc4ba8734
阅读完整原作者说明 ↗

来源与内容状态

本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。

原作者:ssrjkk/agent-skills · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-11T03:01:42.252Z。

分类由名称、说明与路径规则生成,分类不代表已核实适配。

许可与权利归属

MIT。第三方内容及版权归原作者,使用条件以原文为准。

许可原文 ↗

本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。

限制与注意事项

  • 元数据收录不代表本站已经安装、适配、实测或进行安全审查。