Skip to main content

api-documenter

Generate API documentation: OpenAPI 3.1 specs, interactive docs with Swagger/Redoc, SDK generation, and JSDoc/TSDoc extraction.

소스 정보

저장소
ThinkfleetAI/thinkfleet-engine
최근 소스 활동
2026년 2월 1일 16:21
감지된 SKILL.md 언어
영어
스타
0
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
api-documenter
description
Generate API documentation: OpenAPI 3.1 specs, interactive docs with Swagger/Redoc, SDK generation, and JSDoc/TSDoc extraction.
metadata
{"thinkfleetbot":{"emoji":"📖","requires":{"anyBins":"[Truncated]"}}}
# API Documentation Generate and maintain API documentation from code and OpenAPI specs. ## OpenAPI Spec Validation ```bash # Validate an OpenAPI spec npx @apidevtools/swagger-cli validate openapi.yaml # Bundle split spec files into one npx @apidevtools/swagger-cli bundle openapi.yaml -o openapi-bundled.yaml ``` ## Interactive Docs ### Swagger UI ```bash # Serve Swagger UI locally npx @redocly/cli preview openapi.yaml # Or with Docker docker run -p 8080:8080 -e SWAGGER_JSON=/spec/openapi.yaml -v $(pwd):/spec swaggerapi/swagger-ui ``` ### Redoc ```bash # Generate static HTML docs npx @redocly/cli build-docs openapi.yaml -o docs.html # Preview with hot reload npx @redocly/cli preview-docs openapi.yaml ``` ## Generate OpenAPI from Code ### Express/Node.js with swagger-jsdoc ```bash # Install npm install swagger-jsdoc swagger-ui-express # Generate spec from JSDoc annotations node -e " const swaggerJsdoc = require('swagger-jsdoc'); const spec = swaggerJsdoc({ definition: { openapi: '3.1.0', info: { title: 'My API', version: '1.0.0' } }, apis: ['./src/routes/*.ts'], }); console.log(JSON.stringify(spec, null, 2)); " > openapi.json ``` ### FastAPI (Python — auto-generates) ```bash # FastAPI generates OpenAPI automatically at /docs # Export the spec: curl -s http://localhost:8000/openapi.json | jq . > openapi.json ``` ## TypeDoc (TypeScript Documentation) ```bash # Generate docs from TypeScript npx typedoc --entryPoints src/index.ts --out docs/api # JSON output npx typedoc --json docs/api.json --entryPoints src/index.ts # With README npx typedoc --entryPoints src/index.ts --out docs/api --readme README.md ``` ## JSDoc Extraction ```bash # Generate HTML docs from JSDoc comments npx jsdoc src/ -r -d docs/ # With custom template npx jsdoc src/ -r -d docs/ -t node_modules/clean-jsdoc-theme ``` ## SDK Generation from OpenAPI ```bash # Generate TypeScript client npx openapi-typescript openapi.yaml -o src/api-types.ts # Generate full SDK with openapi-generator npx @openapitools/openapi-generator-cli generate \ -i openapi.yaml \ -g typescript-fetch \ -o src/generated/api # Python client npx @openapitools/openapi-generator-cli generate \ -i openapi.yaml \ -g python \ -o generated/python-client ``` ## Linting OpenAPI Specs ```bash # Redocly lint npx @redocly/cli lint openapi.yaml # Spectral (custom rules) npx @stoplight/spectral-cli lint openapi.yaml ``` ## Notes - Write the OpenAPI spec first (design-first), then implement. It's faster than code-first for teams. - Keep specs in version control alongside the code. - Validate specs in CI — broken docs are worse than no docs. - SDK generation saves client teams significant time. Regenerate on every API change. - Use `$ref` to split large specs into manageable files.
GitHub에서 보기