Skip to content
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

cannot use example code to generate #255

Closed
LeeWong opened this issue Nov 7, 2016 · 2 comments
Closed

cannot use example code to generate #255

LeeWong opened this issue Nov 7, 2016 · 2 comments

Comments

@LeeWong
Copy link

LeeWong commented Nov 7, 2016

protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go_out=Mgoogle/api/annotations.proto=github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api,plugins=grpc:. /home/lee/IdeaProjects/go_api_gateway/src/api_gateway/rest/test_service.proto
/home/lee/IdeaProjects/go_api_gateway/src/api_gateway/rest/test_service.proto: File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think).

@LeeWong
Copy link
Author

LeeWong commented Nov 7, 2016

protoc -I/usr/local/include -I. \

-I$GOPATH/src
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis
--grpc-gateway_out=logtostderr=true:.
/home/lee/IdeaProjects/go_api_gateway/src/api_gateway/rest/test_service.proto
/home/lee/IdeaProjects/go_api_gateway/src/api_gateway/rest/test_service.proto: File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think).

@tmc
Copy link
Collaborator

tmc commented Nov 7, 2016

@LeeWong I'm going to close this as it isn't really a grpc-gateway problem but a protoc invocation issue. You need to supply a relative path to the .proto file.

perhaps you should try: protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go_out=Mgoogle/api/annotations.proto=github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api,plugins=grpc:. test_service.proto with cwd = /home/lee/IdeaProjects/go_api_gateway/src/api_gateway/rest

@tmc tmc closed this as completed Nov 7, 2016
@tamalsaha tamalsaha mentioned this issue Mar 30, 2017
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants