-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please help: google/api/annotations.proto: File not found. #283
Comments
@pzsfeng I think you are missing the import part in your
I believe this ^ maps This is from the README |
@fiibbb Thanks for taking a look.
I didn't quite understand it. Could you please mention how to invoke it? Thanks. |
Just doing a little bit of tidying. I hope that your question was answered in a way that let your project continue. If you have any more questions feel free to reopen this issue. |
Hi @cappucino5. Please reach out for help with this type of matter on chat services such as Gophers slack channel. This is not the best medium for this kind of debugging. |
Hi,
I am a grpc newbie, like gprc and am looking forward to auto-generate REST API from my .proto files.
I am probably making some mistake in my setup. Could you please take a look and help? Am I missing a package? Am I invoking the protoc with incorrect params?
My setup details are below.
I am unable to compile the .proto file with the annotation.
Building proto files...
google/api/annotations.proto: File not found.
serverrpc.proto: Import "google/api/annotations.proto" was not found or had errors.
-- My script
export SCRIPTDIR=/libera
export GOPATH=$SCRIPTDIR
echo "Building proto files..."
export PATH=$PATH:$SCRIPTDIR/bin
cd $SCRIPTDIR/bin
protoc -I$SCRIPTDIR/src/server/rpcdef/
-I$SCRIPTDIR/src/vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--go_out=$SCRIPTDIR/src/server/rpcdef $SCRIPTDIR/src/server/rpcdef/serverrpc.proto
-- Directory layout
[root@63f0407abe77 libera]# pwd
/libera
[root@63f0407abe77 libera]# ls bin/
gvt protoc protoc-gen-go protoc_bk server.log
[root@63f0407abe77 libera]#
[root@63f0407abe77 libera]# ls src/server/rpcdef/
serverrpc.pb.go serverrpc.proto
The vendor dir below has all the packages required:
[root@63f0407abe77 src]# pwd
/libera/src
[root@63f0407abe77 src]# ls vendor/
cloud.google.com github.com go4.org golang.org google.golang.org gopkg.in manifest
-- serverrpc.proto file
1 syntax = "proto3";
2
3 package serversvc;
4
5 import "google/api/annotations.proto";
6
7 // The greeting service definition.
8 service ServerSvc {
9 // Sends a greeting
10 rpc GetStatus (ServerSvcStatusRequest) returns (ServerSvcStatusResponse) {
11 option (google.api.http) = {
12 post: "/v1/getstatus"
13 body: "*"
14 };
15 }
[root@63f0407abe77 bin]# ./protoc --version
libprotoc 3.1.0
The text was updated successfully, but these errors were encountered: