REST API Designer + Implementer

作者:promptpacks发布日期:2026-09-21观看:30

Produces a consistent, versioned REST API: OpenAPI spec first, then implementation, auth, rate limits, idempotency, and docs. Great for new services.

01/ 01

Design and implement a REST API for {{DOMAIN, e.g. an orders service}} in {{framework: FastAPI / Express / Spring Boot}}. First produce the OpenAPI 3.1 contract (YAML) for resources {{RESOURCES}} with: - Plural nouns, nested routes only where ownership is real, kebab-case URLs, stable versioning via /v1. - Pagination (cursor-based), filtering, sorting, and field selection conventions. - JSON:API-ish consistent envelope or RFC 7807 problem+json errors — pick one and justify it; include correlation-id on every response. - Authn: OAuth2 bearer (JWT) + scopes; Authz matrix table (role × action). - Idempotency-Key support for POST; ETag/If-Match for optimistic concurrency. - Rate limits (429 + Retry-After) and per-tenant quotas. - Example request/response for every endpoint, including 400/401/403/404/409/422/429/500. Then implement it with: service/repository separation, input validation, transactional writes, structured logs, metrics (RED), and OpenAPI-generated types for the client. Include pytest/Jest integration tests for authz matrix, idempotency replay, and concurrent update conflicts. Do not code until I approve the contract. ================================================================================

自动翻译

自动翻译中…

🔥热搜词

评论0

登录后参与评论

还没有评论,来抢沙发吧