-
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
Question: How to use grpc_api_configuration when using grpc-agteway remote plugin? #3217
Comments
Hi. It's not possible to use an external configuration file with the Buf remote plugins, unfortunately. Your best option is to either stop using a separate file and move to annotations, or use a local plugin. This is because this option to the grpc-gateway breaks the contract for running protobuf plugins, and it's not Buf's fault. Do you think we should add some documentation to explain this problem to users? |
Hi @johanbrandhorst, understood, thank you for the fast response! I am new to the whole protobuf/grpc world, so for me it wasn't clear that using the config file violates the remote plugin contract. I'd say yes, add a note that On a sidenote: Do you have an idea how one could use bufs docker image with grpc-gateway/openapiv2 with local plugins? I try to make the generation as easy and deterministic as possible, no matter the devs system, so ideally everyone just uses |
I actually wrote a blog post on this very topic 😄: https://jbrandhorst.com/post/plugin-versioning/. For the docs, would you be willing to contribute an update to our README or docs to clarify this behavior for others? |
thanks for the blogpost! opened a PR :) |
📚 Documentation
Hi 👋 I want to dockerize the generation of gateway code for my makefile, using the bufbuild/buf docker container and remote plugins. Now I struggle with generating the gateway code and cannot find a good doc on that one, so I added it under "documentation" for now.
My config in
buf.gen.yaml
is:and I've put everything in a flat folder structure to try it out.
Then i cd inside that folder and run
docker run --rm -v `pwd`:`pwd` -w `pwd` bufbuild/buf generate .
Result: It generates the *.pb.go and *_grpc.pb.go in a former step also using remote plugins, so I guess that works generally.
But: It always fails with
Failure: plugin "buf.build/grpc-ecosystem/gateway:v2.15.2" failed: failed to read gRPC API Configuration description from "gw_mapping.yaml": open gw_mapping.yaml: no such file or directory
and tbh I have no clue if what I try to achieve here is even possible :) The examples at https://github.com/grpc-ecosystem/grpc-gateway#usage-with-remote-plugins don't use it. So would be great to clarify!The text was updated successfully, but these errors were encountered: