I wanted to test out gRPC to potentially swap our existing system to work with it.
The issue
I cloned grpc-kotlin to use their examples and chose to set up hellowworld
example.
Following all the steps, I initialized the server and everything worked as expected.
I then wanted to add gRPC-Gateway into the mix, as we will need to slowly transition into gRPC from an existing REST architecture.
I'm really new to bazel and gRPC so I tried my best to follow the steps, and tried to add the following into the hello_world.proto.
import "google/api/annotations.proto";
// The greeting service definition.
service Greeter {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {
option (google.api.http) = {
post: "/v1/example/echo"
body: "*"
};
}
}
Note that when I click into the import "google/api/annotations.proto";
it takes me to the following file:
annotations.proto file
which seems to be the correct annotations.proto
file that I've been meaning to use.
However, when I rebuild, I'm getting the following error: error
What I have tried
I manually copied http.proto
and annotations.proto
to a folder called google/api/
inside proto
as instructed in this thread, but the issue didn't fix itself, as it seems like http.proto
is trying to import google/protobuf/descriptor.proto
and then I'm getting an error that that file cannot be found.