{"id":43316113,"url":"https://github.com/albenik/twirp-openapi-gen","last_synced_at":"2026-02-01T22:03:23.057Z","repository":{"id":44055241,"uuid":"448375232","full_name":"albenik/twirp-openapi-gen","owner":"albenik","description":"A Twirp RPC OpenAPI generator implemented as `protoc` plugin","archived":false,"fork":false,"pushed_at":"2023-11-19T14:18:21.000Z","size":14,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-21T01:50:46.172Z","etag":null,"topics":["golang","openapi","protobuf","protoc","protoc-gen","protoc-plugin","swagger","twirp"],"latest_commit_sha":null,"homepage":"","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/albenik.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":"2022-01-15T19:46:00.000Z","updated_at":"2023-06-17T13:56:39.000Z","dependencies_parsed_at":"2022-09-01T00:51:02.369Z","dependency_job_id":null,"html_url":"https://github.com/albenik/twirp-openapi-gen","commit_stats":null,"previous_names":["albenik-go/twirp-openapi-gen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/albenik/twirp-openapi-gen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albenik%2Ftwirp-openapi-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albenik%2Ftwirp-openapi-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albenik%2Ftwirp-openapi-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albenik%2Ftwirp-openapi-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albenik","download_url":"https://codeload.github.com/albenik/twirp-openapi-gen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albenik%2Ftwirp-openapi-gen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28992656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T22:01:47.507Z","status":"ssl_error","status_checked_at":"2026-02-01T21:58:37.335Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["golang","openapi","protobuf","protoc","protoc-gen","protoc-plugin","swagger","twirp"],"created_at":"2026-02-01T22:03:21.756Z","updated_at":"2026-02-01T22:03:23.052Z","avatar_url":"https://github.com/albenik.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# twirp-openapi-gen\n\nA Twirp RPC OpenAPI generator implemented as `protoc` plugin\n\n*Currently supports only OpenAPI 2.0*\n\n# Usage\n\nInstalling the generator for protoc/buf:\n\n```\ngo install github.com/albenik/twirp-openapi-gen/cmd/protoc-gen-twirp-openapi@latest\n```\n\n## Run whith the protoc\n\n```\nprotoc -twirp-openapi_out=api/foo -twirp-openapi_opt=hostname=api.example.com,path_prefix=/api/v1 rpc/service.proto\n```\n\n## Run with [buf.build](https://buf.build):\n\n`buf.gen.yaml`:\n\n```yaml\nversion: v1\nplugins:\n  - name: twirp-openapi\n    out: api/foo\n    opt:\n     - hostname=api.example.com\n     - path_prefix=/api/v1\n```\n\n# Motivation\n\nThe only working generator referenced by [Twirp](https://github.com/twitchtv/twirp) project and found by me\nis [go-bridget/protoc-gen-twirp_swagger](https://github.com/go-bridget/twirp-swagger-gen). It lacks support of map (at\nleast) and also does not work with advanced buf configuration when `buf.work.yaml` and `buf.gen.yaml` placed on the\ndifferent levels.\n\nI started from a PR to the original [go-bridget/twirp-swagger-gen](https://github.com/go-bridget/twirp-swagger-gen) but later\ndecided to write generator from scratch. I dropped stadalone proto parser package and just rely on already parsed\nstructure from `protogen`. Also I don't use OpenAPI spec go-package and replaced it by hand-written structures, which\nare incomplete buf much more comfortable to use.\n\nThe generated output is suitable for Swagger-UI.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbenik%2Ftwirp-openapi-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbenik%2Ftwirp-openapi-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbenik%2Ftwirp-openapi-gen/lists"}