swaggoapi
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "swaggoapi" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-df4cb291801e339a5a096a59a989b93ffc925fef5a51471764b0d2dc9ca168cf. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/generate-go-api-docs-from-source-annotations-with-swag before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Swag (Swaggo) is used to convert Go handler annotations into reviewable Swagger 2.0 documentation before a proxy requires that conversion; use it when API docs, clients, or release checks depend on this output.
Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Software, accounts and paid services
- Go 1.19 or newer; Swag CLI or Docker image; Go API source tree with handler annotations
- Testing
- Not tested
Browse files
Frontmatter
name: "使用 Swag 从源代码注释生成 Go API 文档"
slug: "generate-go-api-docs-from-source-annotations-with-swag"
version: "1.0.0"
displayName: "使用 Swag 从源码注释生成 Go API 文档"
summary: "在代理需要将 Go 处理程序注解转换为可审查的 Swagger 2.0 文档之前,如果 API 文档、客户端或发布检查依赖于它,则使用 Swag。"
license: "MIT"
description: "在代理需要将 Go 处理程序注解转换为可审查的 Swagger 2.0 文档之前,如果 API 文档、客户端或发布检查依赖于此,则使用 Swag。"
github_stars: 12867
verification: "security_reviewed"
source: "https://github.com/1991513ccie-png/skills"
author: "1991513ccie-png"
publisher_type: "individual"
category: "Library & API Reference"
framework: "Multi-Framework"
tool_ecosystem:
github_repo: "1991513ccie-png/skills"
github_stars: 12867使用 Swag 从源码注释生成 Go API 文档
Use Swag when an agent needs to turn Go handler annotations into reviewable Swagger 2.0 documentation before API docs, clients, or release checks depend on it.
Prerequisites
Go 1.19 or newer; Swag CLI or Docker image; Go API source tree with handler annotations
Installation
Use the upstream install or setup path that matches your environment:
- go install github.com/swaggo/swag/cmd/swag@latest
- docker run --rm -v $(pwd):/code ghcr.io/swaggo/swag:latest
- Make sure to import the generated docs/docs.go so that your specific configuration gets init'ed. If your General API annotations do not live in main.go, you can let swag know with -g flag.
- Make it OR condition
Requirements and caveats from upstream:
- Alternatively you can run the docker image:
- --dir value, -d value Directories you want to parse,comma separated and general-info file must be in the first one (default: "./")
- | x-name | The extension key, must be start by x- and take only json value | // @x-example-key {"key": "value"} |
Basic usage or getting-started notes:
-
Add comments to your API source code, See Declarative Comments Format.
-
Extracted from upstream docs: https://raw.githubusercontent.com/swaggo/swag/HEAD/README.md
Documentation
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 Swag 工具的使用指导,帮助 Go 开发者将源码注释转换为标准 Swagger 2.0 文档
- 适用于 API 文档生成、客户端生成和发布检查等实际开发场景
Highlights
- 触发描述清晰明确,准确表达了使用 Swag 生成 Go API 文档的核心功能
Areas to improve
-
缺少 When to Use/示例章节 Reported severity: Minor
文档缺少清晰的 Phase/步骤划分和端到端示例,影响用户理解和执行
Recommendation: 建议补充具体的操作步骤划分和完整的使用示例,包括从注释编写到文档生成的完整流程
Highlights
- frontmatter 完整,包含必要的元数据信息
Areas to improve
-
主要异常未处理 Reported severity: Major
未覆盖网络失败、权限问题、Go 版本不兼容等主要异常场景
Recommendation: 建议补充常见错误处理方案,如网络超时重试、权限检查、Go 版本验证等
Highlights
- 提供了 go install 和 docker run 两种安装方式,参数基本正确
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- github.com
- raw.githubusercontent.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Go 1.19 or newer; Swag CLI or Docker image; Go API source tree with handler annotations
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.