api icon indicating copy to clipboard operation
api copied to clipboard

Is there a better way to generate the *.pb.h.cpp *.grpc.h.cpp files?

Open ZezhongWang opened this issue 2 years ago • 0 comments

If I use buf generate buf.build/authzed/api, it will only generate authzed/api/ c++ code, without dependencies needed like google/api. How I fix this problem now is I copy all the .proto files into following folder structure:

Protos
├── authzed
│   └── api
│       └── v1
│           ├── core.proto
│           ├── debug.proto
│           ├── error_reason.proto
│           ├── openapi.proto
│           ├── permission_service.proto
│           ├── schema_service.proto
│           └── watch_service.proto
├── google
│   └── api
│       ├── annotations.proto
│       └── http.proto
├── protoc-gen-openapiv2
│   └── options
│       ├── annotations.proto
│       └── openapiv2.proto
└── validate
    └── validate.proto

But I think it's not an elegant way to do that if authzed dependencies and itself have updates, then I need to redo those copy again. I think it would be nice that buf generate will also generate dependencies minimal set needed. Is there a better way to achieve this?

ZezhongWang avatar Jan 30 '23 09:01 ZezhongWang