{"id":13694124,"url":"https://github.com/caixw/apidoc","last_synced_at":"2025-12-25T18:29:51.991Z","repository":{"id":57484849,"uuid":"39192462","full_name":"caixw/apidoc","owner":"caixw","description":"RESTful API 文档生成工具，支持 Go、Java、Swift、JavaScript、Rust、PHP、Python、Typescript、Kotlin 和 Ruby 等大部分语言。","archived":false,"fork":false,"pushed_at":"2023-07-26T03:57:41.000Z","size":3679,"stargazers_count":846,"open_issues_count":5,"forks_count":108,"subscribers_count":47,"default_branch":"master","last_synced_at":"2024-11-12T20:46:47.846Z","etag":null,"topics":["api","apidoc","document","documentation-generator","go","golang","rest","rest-api","rest-api-documentation","restful","restful-api","tools"],"latest_commit_sha":null,"homepage":"https://apidoc.tools","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caixw.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-07-16T11:09:18.000Z","updated_at":"2024-11-09T08:54:55.000Z","dependencies_parsed_at":"2024-01-14T19:06:30.441Z","dependency_job_id":"679454a8-0735-4793-9ddf-db603a566387","html_url":"https://github.com/caixw/apidoc","commit_stats":{"total_commits":1884,"total_committers":5,"mean_commits":376.8,"dds":0.002123142250530785,"last_synced_commit":"b3a29abd008be84baa6d14a1c2928d671987bafe"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caixw%2Fapidoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caixw%2Fapidoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caixw%2Fapidoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caixw%2Fapidoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caixw","download_url":"https://codeload.github.com/caixw/apidoc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252130397,"owners_count":21699082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","apidoc","document","documentation-generator","go","golang","rest","rest-api","rest-api-documentation","restful","restful-api","tools"],"created_at":"2024-08-02T17:01:24.938Z","updated_at":"2025-12-25T18:29:46.953Z","avatar_url":"https://github.com/caixw.png","language":"Go","funding_links":[],"categories":["Go","Repositories"],"sub_categories":[],"readme":"# apidoc\n\n[![Test Status](https://github.com/caixw/apidoc/workflows/Test/badge.svg?branch=master)](https://github.com/caixw/apidoc/actions?query=workflow%3ATest)\n[![Latest Release](https://img.shields.io/github/release/caixw/apidoc.svg?style=flat-square)](https://github.com/caixw/apidoc/releases/latest)\n[![Go Report Card](https://goreportcard.com/badge/github.com/caixw/apidoc)](https://goreportcard.com/report/github.com/caixw/apidoc)\n[![codecov](https://codecov.io/gh/caixw/apidoc/branch/master/graph/badge.svg)](https://codecov.io/gh/caixw/apidoc)\n![Go version](https://img.shields.io/github/go-mod/go-version/caixw/apidoc)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/caixw/apidoc/v7)](https://pkg.go.dev/github.com/caixw/apidoc/v7)\n![License](https://img.shields.io/github/license/caixw/apidoc)\n\napidoc 是一个简单的 RESTful API 文档生成工具，它从代码注释中提取特定格式的内容，生成文档。\n\n目前支持以下语言：C#、C/C++、D、Dart、Erlang、Go、Groovy、Java、JavaScript、Julia、Kotlin、Lisp/Clojure、Lua、Nim、Pascal/Delphi、Perl、PHP、Python、Ruby、Rust、Scala、Swift、Typescript 和 Zig。\n\n具体文档可参考：\u003chttps://apidoc.tools\u003e\n\n```go\n/**\n * \u003capi method=\"GET\" summary=\"获取所有的用户信息\"\u003e\n *     \u003cpath path=\"/users\"\u003e\n *         \u003cquery name=\"page\" type=\"number\" default=\"0\" summary=\"显示第几页的内容\" /\u003e\n *         \u003cquery name=\"size\" type=\"number\" default=\"20\" summary=\"每页显示的数量\" /\u003e\n *     \u003c/path\u003e\n *     \u003ctag\u003euser\u003c/tag\u003e\n *     \u003cserver\u003eusers\u003c/server\u003e\n *     \u003cresponse status=\"200\" type=\"object\" mimetype=\"application/json\"\u003e\n *         \u003cparam name=\"count\" type=\"int\" optional=\"false\" summary=\"符合条件的所有用户数量\" /\u003e\n *         \u003cparam name=\"users\" type=\"object\" array=\"true\" summary=\"用户列表\"\u003e\n *             \u003cparam name=\"id\" type=\"int\" summary=\"唯一 ID\" /\u003e\n *             \u003cparam name=\"name\" type=\"string\" summary=\"姓名\" /\u003e\n *         \u003c/param\u003e\n *         \u003cexample mimetype=\"application/json\"\u003e\n *         \u003c![CDATA[\n *         {\n *             \"count\": 500,\n *             \"users\": [\n *                 {\"id\":1, \"name\": \"管理员2\"},\n *                 {\"id\":2, \"name\": \"管理员2\"}\n *             ],\n *         }\n *         ]]\u003e\n *         \u003c/example\u003e\n *     \u003c/response\u003e\n *     \u003cresponse status=\"500\" mimetype=\"application/json\" type=\"object\"\u003e\n *         \u003cparam name=\"code\" type=\"int\" summary=\"错误代码\" /\u003e\n *         \u003cparam name=\"msg\" type=\"string\" summary=\"错误内容\" /\u003e\n *     \u003c/response\u003e\n * \u003c/api\u003e\n */\nfunc login(w http.ResponseWriter, r *http.Request) {\n    // TODO\n}\n```\n\n## 使用\n\nmacOS 和 linux 可以使用 homebrew 安装：\n\n```shell\nbrew tap caixw/brew\nbrew install caixw/brew/apidoc\n```\n\n同时在 \u003chttps://github.com/caixw/apidoc/releases\u003e 提供了部分主流系统下的可用二进制。\n\n如果你使用的系统不在此列，则需要手动下载编译：\n\n```shell\ngit clone https://github.com/caixw/apidoc.git\ncd apidoc\n./scripts/build.sh\n```\n\n支持多种本地化语言，默认情况下会根据当前系统所使用的语言进行调整。也可以通过设置环境变更 `LANG` 指定一个本地化信息。*nix 系统也可以使用以下命令：\n\n```shell\nLANG=lang apidoc # lang 设置为你需要的语言 ID，比如 zh-hans 等。\n```\n\n具体的安装和使用细节可参考 \u003chttps://apidoc.tools/#usage\u003e。\n\n## 集成\n\n若需要将 apidoc 当作包集成到其它 Go 程序中，可参考以下代码：\n\n```go\nimport (\n    \"golang.org/x/text/language\"\n\n    \"github.com/caixw/apidoc/v7\"\n    \"github.com/caixw/apidoc/v7/core\"\n    \"github.com/caixw/apidoc/v7/build\"\n)\n\n// 初始本地化内容\napidoc.SetLocale(language.MustParse(\"zh-Hans\"))\n\n// 可以自定义实现具体的错误处理方式\nh := core.NewHandler(...)\n\noutput := \u0026build.Output{...}\ninputs := []*build.Input{...}\n\napidoc.Build(h, output, inputs...)\n```\n\n具体可查看文档：\u003chttps://pkg.go.dev/github.com/caixw/apidoc/v7\u003e\n\n## 参与开发\n\n请阅读 [CONTRIBUTING.md](CONTRIBUTING.md) 文件的相关内容。\n\n## 版权\n\n本项目源码采用 [MIT](https://opensource.org/licenses/MIT) 开源授权许可证，完整的授权说明可在 [LICENSE](LICENSE) 文件中找到。\n\n文档内容的版权由各个文档各自表述。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaixw%2Fapidoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaixw%2Fapidoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaixw%2Fapidoc/lists"}