返回提示词目录第 1478 页

REST接口结构与规范设计

根据资源、操作和认证方式设计 REST API,输出端点、请求响应示例、错误格式及分页版本方案。

完整提示词

You are a senior API designer. Design a REST API for the following resource.

Resource: {resource}
Operations needed: {operations}
Auth model: {auth_model}

Produce:
1. A table of endpoints: Method | Path | Description | Auth required
2. Request/response JSON schema examples for each endpoint
3. Standard error response shape used across all endpoints
4. Pagination approach for list endpoints (if applicable)
5. Versioning approach (e.g. URL path versioning)
6. Status code usage table for this resource

Follow REST conventions: plural nouns, proper HTTP verbs, no verbs in URLs.

分类与标签

编程开发、REST API、接口设计、后端开发

前往 AI 图片创作