feat(generator): harden opaque imports and fix snake case to go casing#6279
Merged
johanbrandhorst merged 8 commits intogrpc-ecosystem:mainfrom Jan 26, 2026
Merged
Conversation
[WHY] Opaque handlers were missing imports for nested body types and snake_case messages/enums produced invalid Go identifiers, causing broken builds when `--use_opaque_api` was enabled. [WHAT] Camel-case message/enum GoType helpers, register body-field packages during generation, and add example protos under `examples/internal/proto/examplepb` (opaque import + snake-case service/RPC names) and `examples/internal/proto/sub` (snake-case type) so `go test ./...` guards the regressions without extra generator-only tests. [HOW] Relocated the opaque example, regenerated it against the opaque API, extended the gateway generator to track external body packages, and leaned on the compiled examples instead of bespoke generator tests. [TEST] go test ./... [RISK] Low; scoped to generators/examples. Fixes grpc-ecosystem#6276, grpc-ecosystem#6277
johanbrandhorst
requested changes
Jan 26, 2026
Collaborator
johanbrandhorst
left a comment
There was a problem hiding this comment.
This looks great, just looks like some of the Bazel files need a small fix, thank you!
…update message references - Introduced `OpaquePatchProductNameRequest` and `OpaquePatchProductNameResponse` types to the example proto. - Registered new request/response types in the services and updated references to message indices accordingly.
This commit deletes the outdated `examplepb/BUILD.bazel` file and eliminates unused proto and Bazel rule definitions. It also updates dependencies in `examplepb_opaque_proto` and `examplepb_opaque_go_proto` to include a missing reference to `sub_proto`, improving build correctness and simplifying the overall setup.
Contributor
Author
Thanks! Sorry for all the pushes, I am not a Bazel expert by any means. Hopefully should be fixed now. |
This was referenced Jan 28, 2026
This was referenced Apr 23, 2026
fix(deps): vuln minor upgrades — 11 packages (minor: 7 · patch: 4) [server]
DataDog/temporalio-ui#27
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References to other Issues or PRs
Have you read the Contributing Guidelines?
Yes
Brief description of what is fixed or changed
--use_opaque_api) import the modulesthey instantiate.
descriptor.Message.GoType/Enum.GoType, ensuring proto names such asCreate_bookresolve to valid Go identifiers.examples/internal/proto/examplepb(opaque import with snake_case service/RPC names) andexamples/internal/proto/sub(snake-case messages) sogo test ./...guards both regressions without generator-onlyunit tests.
Other comments
go build ./...go test ./...