{"id":15522053,"url":"https://github.com/monkeywie/proto2swagger","last_synced_at":"2025-10-14T08:07:03.989Z","repository":{"id":127779742,"uuid":"325453619","full_name":"monkeyWie/proto2swagger","owner":"monkeyWie","description":"A tool for convert proto file to swagger.json.","archived":false,"fork":false,"pushed_at":"2021-01-27T09:54:15.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-10T05:09:37.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monkeyWie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-30T04:23:08.000Z","updated_at":"2021-03-16T06:27:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"f335bb78-d6ce-4010-a9e2-093969598895","html_url":"https://github.com/monkeyWie/proto2swagger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/monkeyWie/proto2swagger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeyWie%2Fproto2swagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeyWie%2Fproto2swagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeyWie%2Fproto2swagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeyWie%2Fproto2swagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monkeyWie","download_url":"https://codeload.github.com/monkeyWie/proto2swagger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeyWie%2Fproto2swagger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259967806,"owners_count":22939519,"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":[],"created_at":"2024-10-02T10:39:25.078Z","updated_at":"2025-10-14T08:06:58.957Z","avatar_url":"https://github.com/monkeyWie.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 介绍\n\n这是一个将 proto 文件转换成 OpenAPI2.0(swagger)文档的工具，支持批量转换，并支持同步至 yapi 中。\n\n## 使用\n\n复制`config.json.tpl`文件在项目根目录，命名为`config.json`，修改配置选项：\n\n| 选项       | 描述                                                  | 示例                 |\n| ---------- | ----------------------------------------------------- | -------------------- |\n| baseDir    | proto 文件所属顶级目录，支持多层目录                  | ~/code/protos        |\n| serverHost | yapi 服务地址                                         | https://yapi.xxx.com |\n| projectId  | yapi 项目 ID，通过浏览器访问对应的项目并从 uri 中获得 | 11                   |\n| cookie     | yapi 用户 cookie，通过浏览器 network 面板抓包获得     |                      |\n\n运行`npm run build`即可完成转换和导入。\n\n## 说明\n\n### proto 文件示例\n\n```proto\nsyntax = \"proto3\";\n\npackage user;\n\nmessage UserAddReq {\n  string name = 1; // 用户名\n  int32 age = 2;   // 年龄\n}\n\nmessage UserAddResp {}\n```\n\n### 产出目录\n\n- ./build/temp\n  存放修改后的 proto 文件\n\n- ./build/generated\n  存放转换后的 swagger.json 文件\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkeywie%2Fproto2swagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonkeywie%2Fproto2swagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkeywie%2Fproto2swagger/lists"}