Loading...
Loading...
Génère une documentation d'API claire et structurée à partir de code, routes ou descriptions. À utiliser quand l'utilisateur veut documenter une API REST, GraphQL ou des endpoints. Se déclenche aussi avec "documente mon API", "swagger", "endpoint documentation", "API docs", ou quand l'utilisateur montre des routes/controllers. Also triggers on "document my API", "generate API docs", "OpenAPI documentation".
npx skill4agent add khalilbenaz/claude-skills-collection dev-api-doc-generator| Champ | Contenu attendu |
|---|---|
| Méthode + URL | |
| Description | Action métier claire, pas le nom de la fonction |
| Path params | |
| Query params | nom, type, requis/optionnel, valeur par défaut |
| Request body | schéma JSON avec types, requis, exemples |
| Headers requis | |
| Réponses | 200/201/204 succès + 400/401/403/404/422/500 erreurs |
| Auth | scope/rôle requis si applicable |
openapi: 3.1.0
info:
title: Payments API
version: 1.0.0
paths:
/api/v1/payments:
post:
summary: Créer un paiement
tags: [Payments]
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [amount, currency, recipient_id]
properties:
amount:
type: integer
description: Montant en centimes
example: 5000
currency:
type: string
enum: [TND, EUR, USD]
example: TND
recipient_id:
type: string
format: uuid
responses:
"201":
description: Paiement créé
content:
application/json:
example:
id: "pay_abc123"
status: "pending"
"422":
description: Validation échouée
content:
application/json:
example:
error: "amount must be positive"
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT## POST /api/v1/payments
Crée un nouveau paiement.
**Auth** : Bearer JWT requis (`role: operator`)
**Body** (application/json) :
| Champ | Type | Requis | Description |
|---|---|---|---|
| amount | integer | oui | Montant en centimes |
| currency | string | oui | `TND`, `EUR`, `USD` |
| recipient_id | uuid | oui | ID du destinataire |
**Réponses** :
- `201` — Paiement créé : `{ "id": "pay_abc123", "status": "pending" }`
- `401` — Token manquant ou expiré
- `422` — Champ invalide : `{ "error": "amount must be positive" }`# Créer un paiement
curl -X POST "https://api.example.com/api/v1/payments" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 5000,
"currency": "TND",
"recipient_id": "550e8400-e29b-41d4-a716-446655440000"
}'| Méthode | Endpoint | Auth | Description |
|---|---|---|---|
| GET | | JWT | Lister les paiements |
| POST | | JWT | Créer un paiement |
| GET | | JWT | Détail d'un paiement |
| DELETE | | JWT + admin | Annuler un paiement |
| Situation | Format recommandé |
|---|---|
| API publique / SDK tiers | OpenAPI 3.1 YAML + Swagger UI |
| Documentation interne équipe | Markdown structuré |
| Tests manuels / QA | Postman Collection v2.1 |
| API GraphQL | SDL + descriptions de champs |
| Micro-service interne | OpenAPI minimal (pas de UI) |
"string"0"id""pay_abc123"5000"TND"pagelimittotalidpayment_iduser_idapplication/jsonmultipart/form-datacreatePayment()x-stability: stable | beta | deprecatedexamples:example:X-RateLimit-LimitX-RateLimit-Remaining# TODO: à compléter@auth@deprecated