{"id":16586521,"url":"https://github.com/zchee/protoc-gen-openapi","last_synced_at":"2025-10-29T08:32:30.128Z","repository":{"id":57548125,"uuid":"207004447","full_name":"zchee/protoc-gen-openapi","owner":"zchee","description":"protoc-gen-openapi is a plugin for the Google protocol buffer compiler to generate openAPI V3 spec for any given input protobuf.","archived":false,"fork":false,"pushed_at":"2019-09-07T17:43:31.000Z","size":271,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T23:51:07.795Z","etag":null,"topics":["openapi","openapi3","protobuf","protoc","protoc-plugin"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/zchee/protoc-gen-openapi","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zchee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-07T17:43:22.000Z","updated_at":"2023-04-17T23:58:47.000Z","dependencies_parsed_at":"2022-09-26T18:41:09.896Z","dependency_job_id":null,"html_url":"https://github.com/zchee/protoc-gen-openapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zchee%2Fprotoc-gen-openapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zchee%2Fprotoc-gen-openapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zchee%2Fprotoc-gen-openapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zchee%2Fprotoc-gen-openapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zchee","download_url":"https://codeload.github.com/zchee/protoc-gen-openapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238795368,"owners_count":19531727,"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":["openapi","openapi3","protobuf","protoc","protoc-plugin"],"created_at":"2024-10-11T22:51:47.660Z","updated_at":"2025-10-29T08:32:24.599Z","avatar_url":"https://github.com/zchee.png","language":"Go","readme":"# protoc-gen-openapi\n\nThis package copy from [istio.io/tools/openapi/protoc-gen-openapi@593a41c76c5c](https://github.com/istio/tools/tree/593a41c76c5c84a4cd51a4ab0c345630c5ed30ba/openapi/protoc-gen-openapi).\n\n## What's this for?\n\n`protoc-gen-openapi` is a plugin for the Google protocol buffer compiler to generate\nopenAPI V3 spec for any given input protobuf. It runs as a `protoc-gen-` binary that the\nprotobuf compiler infers from the `openapi_out` flag.\n\n## Build `protoc-gen-openapi`\n\n`protoc-gen-openapi` is written in Go, so ensure that is installed on your system. You\ncan follow the instructions on the [golang website](https://golang.org/doc/install) or\non Debian or Ubuntu, you can install it from the package manager:\n\n```bash\nsudo apt-get install -y golang\n```\n\nTo build, first ensure you have the protocol compiler (protoc):\n\n```bash\ngo get github.com/golang/protobuf/proto\n```\nTo build, run the following command from this project directory:\n\n```bash\ngo build\n```\n\nThen ensure the resulting `protoc-gen-openapi` binary is in your `PATH`. A recommended location\nis `$HOME/bin`:\n\n```bash\ncp protoc-gen-openapi $HOME/bin\n```\n\nSince the following is often in your `$HOME/.bashrc` file:\n\n```bash\nexport PATH=$HOME/bin:$PATH\n```\n\n## Using protoc-gen-openapi\n\n---\n**TIP**\n\nThe -I option in protoc is useful when you need to specify proto paths for imports.\n\n---\n\nThen to generate the OpenAPI spec of the protobuf defined by file.proto, run\n\n```bash\nprotoc --openapi_out=output_directory input_directory/file.proto\n```\n\nWith that input, the output will be written to\n\n\toutput_directory/file.json\n\nOther supported options are:\n*   `per_file`\n    *   when set to `true`, the output is per proto file instead of per package.\n*   `single_file`\n    *   when set to `true`, the output is a single file of all the input protos specified.\n*   `use_ref`\n    *   when set to `true`, the output uses the `$ref` field in OpenAPI spec to reference other schemas.\n*   `yaml`\n    *   when set to `true`, the output is in yaml file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzchee%2Fprotoc-gen-openapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzchee%2Fprotoc-gen-openapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzchee%2Fprotoc-gen-openapi/lists"}