-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Can't generate code with last version #384
Comments
Using this dependency : $ govendor fetch github.com/googleapis/googleapis/google/api And these commands, it works : $ protoc -I/usr/local/include -I. -I${GOPATH}/src -I../vendor/github.com/googleapis/googleapis --go_out=plugins=grpc:. *.proto
$ protoc -I/usr/local/include -I. -I$GOPATH/src -I../vendor/github.com/googleapis/googleapis --grpc-gateway_out=logtostderr=true:. cmdb.proto
$ protoc -I/usr/local/include -I. -I$GOPATH/src -I../vendor/github.com/googleapis/googleapis --swagger_out=logtostderr=true:. cmdb.proto but build of the project failed :
I don't really undersant how generated code use Master and not Version 1.2.2 |
This tells me that your *.gw.go file is generated using gateway from master branch. The generated file structure was changed in #336 . Regenerate the *.gw.go using gateway from 1.2.2 . This should be fixed. |
Yes.
|
If you use grpc-gateway 1.2.2, then you need to generate the *.gw.go files using grpc-gateway 1.2.2 |
OK. I installed protoc-gen-grpc-gateway and protoc-gen-swagger like that : $ go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
$ go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger This is the error. |
@nlamirault can we consider this issue resolved? perhaps these common gotchas could go into a wiki page? |
@nlamirault If you want to install from your vendor dir, you can do:
|
Thanks. It works fine now. |
It could be helpful to provides binaries into a release files ? |
Hi, I debugged this all the afternoon. I found that in the release grpc-gateway/runtime/context.go Line 47 in 589b126
but in the template.go, it generates code with wrong number of parameters
this is why I keep getting |
Can you try this again with v1.3.0? If you have any more issues, please open a new issue |
I also encountered this problem, I have installed the Google/API/annotations. The proto, but still errors, specific solutions is, please?
|
@cappuccino5, could you either file a new issue with more details or go to the slack channel and work it out there? Thanks! |
hi
i try to update my code to last version (1.2.2):
Dependencies are :
$ govendor list +vendor |grep grpc v github.com/grpc-ecosystem/go-grpc-middleware v github.com/grpc-ecosystem/go-grpc-middleware/util/metautils v github.com/grpc-ecosystem/go-grpc-prometheus v1.1 v1.1 v github.com/grpc-ecosystem/grpc-gateway/runtime v1.2.2 v1.2.2 v github.com/grpc-ecosystem/grpc-gateway/runtime/internal v1.2.2 v1.2.2 v github.com/grpc-ecosystem/grpc-gateway/utilities v1.2.2 v1.2.2 v github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc v github.com/mwitkow/go-grpc-middleware v github.com/mwitkow/go-grpc-middleware/auth v google.golang.org/grpc v1.3.0 v1.3.0 v google.golang.org/grpc/codes v1.3.0 v1.3.0 v google.golang.org/grpc/credentials v1.3.0 v1.3.0 v google.golang.org/grpc/grpclb/grpc_lb_v1 v1.3.0 v1.3.0 v google.golang.org/grpc/grpclog v1.3.0 v1.3.0 v google.golang.org/grpc/health v1.3.0 v1.3.0 v google.golang.org/grpc/health/grpc_health_v1 v1.3.0 v1.3.0 v google.golang.org/grpc/internal v1.3.0 v1.3.0 v google.golang.org/grpc/keepalive v1.3.0 v1.3.0 v google.golang.org/grpc/metadata v1.3.0 v1.3.0 v google.golang.org/grpc/naming v1.3.0 v1.3.0 v google.golang.org/grpc/peer v1.3.0 v1.3.0 v google.golang.org/grpc/stats v1.3.0 v1.3.0 v google.golang.org/grpc/status v1.3.0 v1.3.0 v google.golang.org/grpc/tap v1.3.0 v1.3.0 v google.golang.org/grpc/transport v1.3.0 v1.3.0
I don't find any annotations.proto :
I try to fetch external dependencies :
I find this question on Stackoverflow : strange to copy annotations.proto file ?
Do you any idea ? Thanks
The text was updated successfully, but these errors were encountered: