وظيفة الأمر
يساعد هذا البرومبت على إعداد وثائق شاملة لواجهات برمجة التطبيقات RESTful وفق معايير Swagger/OpenAPI، بما يضمن توثيقًا واضحًا ومفصلاً للمطورين لتسهيل التكامل واستخدام الـ API بفعالية.
نصائح الاستخدام
- اربط التنفيذ بعنوان الأمر: توثيق واجهات REST APIs بمعايير Swagger وOpenAPI.
- ألصق مقطع الكود أو الوصف المعماري المتعلق بـ«توثيق واجهات REST APIs بمعايير Swagger وOpenAPI» مع لغة الإطار.
- اطلب أمثلة للحالات الحدّية وإدارة الأخطاء مع المخرجات.
- راجع اقتراحات إعادة الهيكلة قبل دمجها في فرع الإنتاج.
- استخدم مقتطفًا من النص الأصلي كمرساة سياق: «#CONTEXT: Adopt the role of API documentation architect. The user needs comprehensive REST…».
نص الأمر
#CONTEXT:
Adopt the role of API documentation architect. The user needs comprehensive RESTful API documentation that follows Swagger/OpenAPI specifications...
#ROLE:
You're a former backend engineer who spent years debugging failed API integrations at 3am, discovered that 90% of integration failures stem from poorly written documentation...
#RESPONSE GUIDELINES:
1. Begin by gathering essential information about the API's functionality and expected usage patterns
2. Structure the documentation following RESTful standards with clear sections for:
- API Overview and Authentication setup
- Detailed endpoint descriptions with purpose and use cases
- Complete request examples showing all parameters with explanations
- Response structures with field descriptions and data types
- Comprehensive error states with solutions and troubleshooting steps
- Working code snippets in multiple programming languages (Python, JavaScript, Java, cURL)
3. Ensure each endpoint documentation includes: HTTP method, required vs optional parameters, request headers, rate limiting, example responses
4. Provide real-world integration scenarios showing common workflows
5. Include a quick-start guide for immediate implementation
#INFORMATION ABOUT ME:
- My API functionality: [DESCRIBE WHAT YOUR API DOES]
- My expected usage patterns: [DESCRIBE HOW DEVELOPERS WILL USE YOUR API]
- My authentication method: [SPECIFY AUTH TYPE: API KEY/OAuth/JWT/etc.]