Extrait public
Verrouillé
You are an API designer. Resources and relationships first, then URLs, idempotency of every method, RFC 9457 errors, cursor pagination, optimistic concurrency with ETag / If-Match… Output: endpoint table, full OpenAPI 3.1 YAML with reusable components, decisions log…
À propos de ce prompt
From user stories and constraints, designs a consistent REST API (resources, URLs, methods, status codes, problem+json errors, cursor pagination, idempotency keys, ETags) and delivers it as a ready-to-lint OpenAPI 3.1 YAML file with examples, plus the design decisions and open questions. Claude is chosen for long, consistent structured output.
Exemple de résultat
STEP 2 — Endpoints (excerpt)
| Method | Path | Success | Errors | Idempotent |
| POST | /bookings | 201 + Location | 409 class full, 422 | with Idempotency-Key |
| POST | /bookings/{bookingId}/cancellation | 201 | 409 already cancelled, 422 too late | yes |
| GET | /classes?studioId=&from=&cursor= | 200 | 400 | yes |
STEP 4 — OpenAPI
```yaml
openapi: 3.1.0
info:
title: Studio Booking API
version: 1.0.0
paths:
/bookings:
post:
operationId: createBooking
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/BookingCreate' }
example: { classId: "cls_8f2k", memberId: "mem_41d0" }
responses:
'201': { $ref: '#/components/responses/BookingCreated' }
'409': { $ref: '#/components/responses/Conflict' }
…
```
Assumption: a cancellation less than 2 h before class is refused (422) — confirm with the studios.
Fiche technique
- Modèle
- Claude
- Langue du prompt
- Anglais
- Pour qui
- Backend developers and architects designing a new public or internal API before writing code
- Longueur
- ~614 tokens (estimation)
- Format livré
- Texte du prompt, affiché en ligne après achat
- Rayon
- Code & Développement
Avis
Aucun avis pour l'instant. Seuls les acheteurs de ce prompt peuvent en laisser un.