API documentation generator prompt
Paste an endpoint's code and get full documentation: parameters, request and response examples, and error codes.
متى تستخدم هذا البرومبت
- Before publishing a public or internal API reference.
- When a new endpoint ships without docs.
- When preparing an OpenAPI/Swagger description manually.
نص البرومبت
Write clear API documentation for this {{language}} endpoint, including method, path, parameters, request/response examples, and possible error codes. Style: {{framework}}.
{{CLIPBOARD}}{{language}}{{framework}}{{CLIPBOARD}}الكتلة {{CLIPBOARD}} تُستبدل تلقائياً بما نسخته قبل الضغط على «نسخ».
كيف تستخدمه
- انسخ البرومبت بالزر أو املأ المتغيرات أولاً.
- الصقه في ChatGPT أو Claude أو Gemini.
- عدّل النتيجة أو أعد الطلب بتغيير المتغيرات.
مثال على النتيجة
### POST /api/users
Creates a new user account.
Body parameters:
- email (string, required)
- password (string, required)
Response 201:
{ \"id\": \"u_123\", \"email\": \"a@b.com\" }
Errors:
- 409: email already registeredنصائح للاستخدام
- Paste the route handler plus any validation schema for the most accurate parameter list.
- Ask for OpenAPI/Swagger YAML output if you need it machine-readable.
- Include one real request/response example if you have one, for tone matching.
النماذج الموصى بها
Claude
أسئلة شائعة
- Can it generate an OpenAPI spec instead of markdown?
- Yes, ask for OpenAPI 3.0 YAML output explicitly and it will structure the same information that way.
- What if my endpoint has no comments at all?
- It documents based on the code's actual logic and validation; unclear behavior will be flagged rather than guessed.