{"id":48405064,"url":"https://github.com/oswee/api","last_synced_at":"2026-04-06T02:36:42.365Z","repository":{"id":57542093,"uuid":"205727333","full_name":"oswee/api","owner":"oswee","description":"Oswee API","archived":false,"fork":false,"pushed_at":"2023-02-25T06:35:41.000Z","size":404,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-27T09:06:38.814Z","etag":null,"topics":["grpc-gateway","grpc-go","protobuf","swagger"],"latest_commit_sha":null,"homepage":null,"language":"Starlark","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/oswee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-01T20:13:23.000Z","updated_at":"2020-09-08T14:11:12.000Z","dependencies_parsed_at":"2022-09-08T23:51:41.364Z","dependency_job_id":null,"html_url":"https://github.com/oswee/api","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/oswee/api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oswee%2Fapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oswee%2Fapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oswee%2Fapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oswee%2Fapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oswee","download_url":"https://codeload.github.com/oswee/api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oswee%2Fapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31457723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["grpc-gateway","grpc-go","protobuf","swagger"],"created_at":"2026-04-06T02:36:41.812Z","updated_at":"2026-04-06T02:36:42.359Z","avatar_url":"https://github.com/oswee.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oswee API\n\n[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)\n[![lerna](https://img.shields.io/badge/build%20with-bazel-43A047.svg)](https://bazel.build/)\n\n## Important rules\n\n- Every service in separate files\n- File names with underscore `file_name.proto`\n\n[Uber guidelines](https://github.com/uber/prototool/blob/dev/style/README.md#directory-structure)\n\n[Google Guidelines](https://cloud.google.com/apis/design/versioning)\n\nTool to merge swagger files\n[go-swagger/go-swagger](https://github.com/go-swagger/go-swagger)\n\n## Prerequisites\n\nSet up GOPATH in `~/.zshrc` or `~/bashrc`\n\n`source $HOME/.zshrc`\n\n```sh\nexport GOROOT=/usr/local/go\nexport GOPATH=$HOME/go\nexport GOBIN=$GOPATH/bin\nexport PATH=$PATH:$GOROOT:$GOPATH:$GOBIN\n```\n\nIn order to compile protobufs, `/usr/local/include` should be populated with [protocolbuffers/protobuf](https://github.com/protocolbuffers/protobuf/releases/download/v3.9.1/protoc-3.9.1-linux-x86_64.zip).\nCopy `include/google/protobuf` directory from downloaded archive into `/usr/local/include/google`\n\nInstall grpc-gateway and swagger documentation generator plugins\n\n```sh\ngo get -u github.com/golang/protobuf/protoc-gen-go\ngo get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway\ngo get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger\n```\n\nBy default `go get` installs all packages in `$GOPATH`. If that is not specified then in `$HOME/go`.\n\nCopy content of ``%GOPATH%/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google`` folder to `/usr/local/include/google` folder.\n\n`cp $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google usr/local/include/google`\n\nCopy `annotations.proto` and `openapiv2.proto` files from `%GOPATH%/src/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options` folder to `/usr/local/include/protoc-gen-swagger/options` folder.\n\nIt should look like this:\n\n\u003e :warning: **DEPRECATED**: All external annotations should be included in `./third_party/` directory.\n\n```sh\n/usr/local/include\n├── google\n│   ├── api\n│   │   ├── annotations.proto\n│   │   └── http.proto\n│   ├── protobuf\n│   │   ├── any.proto\n│   │   ├── api.proto\n│   │   ├── compiler\n│   │   │   └── plugin.proto\n│   │   ├── descriptor.proto\n│   │   ├── duration.proto\n│   │   ├── empty.proto\n│   │   ├── field_mask.proto\n│   │   ├── source_context.proto\n│   │   ├── struct.proto\n│   │   ├── timestamp.proto\n│   │   ├── type.proto\n│   │   └── wrappers.proto\n│   └── rpc\n│       ├── code.proto\n│       ├── error_details.proto\n│       └── status.proto\n└── protoc-gen-swagger\n    └── options\n        ├── annotations.proto\n        └── openapiv2.proto\n```\n\n**UPDATE:**\nIn order to make this repository self-contained, i included vendored packages there and moved Oswee API in its own `/oswee/*` directory.\nThis way, no matter where this repository will be hosted or used, all Google and Swagger protobufs will be included and i don't need to rely on `/usr/local/include/*`.\n\n**UPDATE2:** It is not an good idea to move `google/protobuf/*` into repository as it is a part of `protoc` compiler and could lead to mismatch between compiler and used definitions.\n\n## Other\n\nCheck the version of protoc compiler\n\n```sh\nprotoc --version\n```\n\nUpdate `protoc` compiler - [StackOverflow](https://stackoverflow.com/a/57776284/6651080)\n\n## Resources\n\n[GitHub Issue about imports not found](https://github.com/grpc-ecosystem/grpc-gateway/issues/574#issuecomment-376018797)\n\n[Protoc Swagger example](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/proto/examplepb/a_bit_of_everything.proto)\n\n## gRPC endpoint testing\n\n[fullstorydev/grpcui](https://github.com/fullstorydev/grpcui)\n\n## TypeScript\n\nTo generate TypeScript types i am using [grpc-web](https://github.com/grpc/grpc-web) plugin.\nAt time of writing this, TypeScript support is experimental.\n\n### Lerna\n\nCreate personal access token\n\nhttps://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token\n\nCreate `~/.npmrc` (or at project level) file with Auth token (DO NOT COMMIT AUTH TOKEN!!!)\n\nhttps://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages#authenticating-with-a-personal-access-token\n\nCheck the authentication\n\n```sh\nnpm whoami --registry=https://npm.pkg.github.com\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foswee%2Fapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foswee%2Fapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foswee%2Fapi/lists"}