{"meta":{"title":"API 문서","intro":"코드에서 포괄적인 API 문서를 생성합니다.","product":"GitHub Copilot","breadcrumbs":[{"href":"/ko/copilot","title":"GitHub Copilot"},{"href":"/ko/copilot/tutorials","title":"자습서"},{"href":"/ko/copilot/tutorials/customization-library","title":"사용자 지정 라이브러리"},{"href":"/ko/copilot/tutorials/customization-library/prompt-files","title":"프롬프트 파일"},{"href":"/ko/copilot/tutorials/customization-library/prompt-files/document-api","title":"API 문서"}],"documentType":"article"},"body":"# API 문서\n\n코드에서 포괄적인 API 문서를 생성합니다.\n\n데이터 재사용가능.copilot.프롬프트-파일-미리보기-노트 %}\n\n이 프롬프트 파일은 API 코드를 분석해 머신에서 쉽게 읽을 수 있는 표준화된 문서를 만들어 REST API 엔드포인트의 OpenAPI 3.0 사양을 생성합니다.\n\n## OpenAPI 사양 프롬프트\n\n```text copy\n---\nagent: 'agent'\ndescription: 'Generate OpenAPI 3.0 specification for API endpoints'\n---\n\n## Task\n\nAnalyze the API endpoint code and generate a valid OpenAPI 3.0 specification in YAML format.\n\n## OpenAPI Structure\n\nGenerate a complete OpenAPI spec including:\n\n1. **OpenAPI Header**\n   - OpenAPI version (3.0.3)\n   - API info (title, description, version)\n   - Server configuration\n\n2. **Path Definitions**\n   - HTTP method and path\n   - Operation summary and description\n   - Tags for organization\n\n3. **Parameters Schema**\n   - Path parameters with type validation\n   - Query parameters with constraints and defaults\n   - Request body schema using proper JSON Schema\n   - Required vs optional parameters\n\n4. **Response Schemas**\n   - Success responses (200, 201, etc.) with schema definitions\n   - Error responses (400, 401, 404, 500) with error schema\n   - Content-Type specifications\n   - Realistic example values\n\n5. **Components Section**\n   - Reusable schemas for request/response models\n   - Security schemes (Bearer token, API key, etc.)\n   - Common parameter definitions\n\n## Requirements\n\n- Generate valid OpenAPI 3.0.3 YAML that passes validation\n- Use proper JSON Schema for all data models\n- Include realistic example values, not placeholders\n- Define reusable components to avoid duplication\n- Add appropriate data validation (required fields, formats, constraints)\n- Include security requirements where applicable\n\nFocus on: ${input:endpoint_focus:Which specific endpoint or endpoints should be documented?}\n\nGenerate production-ready OpenAPI specification that can be used with Swagger UI, Postman, and code generators.\n```\n\n## 이 프롬프트 파일을 사용하는 방법\n\n1. 위의 콘텐츠를 `document-api.prompt.md` 폴더에 `.github/prompts`로 저장합니다.\n1. Visual Studio Code에서 Copilot Chat 보기를 표시하고 `/document-api`를 입력합니다. 선택적으로, 예를 들어 `endpoint_focus=GET /activities`를 입력하여 어떤 특정 엔드포인트에 대한 문서를 원하는지 지정할 수도 있습니다.\n\nCopilot Chat"}