返回 Skill 列表
extension
分类: 开发与工程无需 API Key

api-protocol

Sunrei项目API协议指南。在编写API端点、请求/响应类型命名以及HTTP方法约定时使用。

person作者: jakexiaohubgithub

API Protocol Guide

RESTful API + OpenAPI 3.0 spec

  • Request type: {HttpMethod}{Name}Params (e.g., GetUserParams, ListUsersParams)
  • Response type: {HttpMethod}{Name}Result (e.g., GetUserResult, ListUsersResult)

HTTP Method Rules

  • GET + singular → single item (e.g., GET /sunreis/{id})
  • List + plural → list items (e.g., GET /sunreis)
  • POST → create
  • PUT → full update
  • PATCH → partial update
  • DELETE → delete

Response Format

  • Success: { "data": ... } or domain key (e.g., { "sunreis": [...] })
  • Error: { "error": { "code": "...", "message": "..." } }
  • Pagination: { "items": [...], "nextToken": "..." }