技能标识:api-docs-generator
从代码注释自动生成 API 文档,支持 OpenAPI/Swagger 格式,输出 JSON 或 YAML。
自动从源代码生成专业的 API 文档。支持 OpenAPI 3.0 和 Swagger 2.0 规范。
| 框架 | 支持 |
|---|---|
| Express.js | ✅ |
| FastAPI |
bash
| 选项 | 说明 |
|---|---|
| --input, -i | 源代码目录 |
| --output, -o |
json
{
openapi: 3.0.0,
info: {
title: My API,
version: 1.0.0,
description: API description
},
paths: {
/api/users: {
get: {
summary: Get all users,
description: Returns a list of users,
responses: {
200: {
description: Successful response,
content: {
application/json: {
schema: {
type: array,
items: { $ref: #/components/schemas/User }
}
}
}
}
}
}
}
}
}
生成的文档可以用于:
bash
api-docs-generator openapi \
--input ./server \
--output ./docs/openapi.json \
--title My API \
--version 1.0.0
bash
api-docs-generator openapi \
--input ./app \
--output ./docs/api.yaml \
--format yaml
bash
以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:
帮我安装 SkillHub 和 api-docs-generator-1776282382 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 api-docs-generator-1776282382 技能
skillhub install api-docs-generator-1776282382
文件大小: 2.24 KB | 发布时间: 2026-4-16 17:17