Closed gigimushroom closed 6 years ago
You need to import it:
# Go to your model directory and
mkdir -p google/api/
# Download the http.proto https://github.com/googleapis/googleapis/tree/master/google/api
curl -L 'https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/http.proto' > google/api/http.proto
# Run protoc again
If this still does not work, you might have to add another protoc --proto-path
pointing to the google
directory
It seems I got errors when using "destination_dir":
protoc --gotemplate_out=debug=false,template_dir=./greeter_server/templates/,destination_dir:./greeter_server protos/proxy.proto 2017/12/14 14:19:27 Err: invalid parameter: "destination_dir"
Sorry, I can't follow how these errors are related
Is there a way to feed 2 proto files together? My proto file A import another file B, if I just run this tool for A, I got "some type" is not defined.
Ok, I figured it out: protoc -I protos/ --gotemplate_out=debug=false,template_dir=greeter_server/templates,destination_dir=greeter_server:greeter_server protos/xxx.proto
option (google.api.http) = { post: "/v1/example/echo_body" body: "*" };
It will output errors: example.proto:32:14: Option "(google.api.http)" unknown.
Is there a workaround?