-
Notifications
You must be signed in to change notification settings - Fork 205
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
oneof types are not properly rendered with protoc-gen-doc #11761
Comments
cocreature
added a commit
that referenced
this issue
Nov 18, 2021
Backport of #11761 changelog_begin changelog_end
cocreature
added a commit
that referenced
this issue
Nov 18, 2021
Backport of #11761 changelog_begin changelog_end
I pushed a branch with an attempt to https://github.com/digital-asset/daml/tree/bump-go-rules-docs However, this currently fails to build:
This looks like somehow we are including multiple variations of the same proto but I don’t understand how. I tried to play around with how we include the |
aherrmann-da
pushed a commit
that referenced
this issue
Nov 25, 2021
Building `//ledger-api/grpc-definitions:ledger-api-docs` [failed with](#11761 (comment)) ``` panic: proto: extension number 65020 is already registered on message google.protobuf.FieldOptions ``` Go dependencies are now pulled in via Gazelle. By default Gazelle will generate new proto rules for any `.proto` files encountered in third party Go dependencies. However, many of these already have pregenerated `.pb.go` files generate with the appropriate configuration. The problem can be avoided by configuring Gazelle to not generate new proto rules, but instead use pre-existing `.pb.go` files. For reference the field number is set in [go-proto-validators](https://github.com/mwitkow/go-proto-validators/blob/32a686adf8b5194d3ea07d632d49b6fb344af678/validator.proto#L19) which is an indirect dependency through protoc-gen-doc. In this case we need to update protoc-gen-validate to v0.6.2 to include bufbuild/protoc-gen-validate@4f41f10 which fixes unknown label errors.
7 tasks
aherrmann-da
added a commit
that referenced
this issue
Nov 25, 2021
* Try to upgrade protobuf docs plugin changelog_begin changelog_end * Fix extension number 65020 is already registered Building `//ledger-api/grpc-definitions:ledger-api-docs` [failed with](#11761 (comment)) ``` panic: proto: extension number 65020 is already registered on message google.protobuf.FieldOptions ``` Go dependencies are now pulled in via Gazelle. By default Gazelle will generate new proto rules for any `.proto` files encountered in third party Go dependencies. However, many of these already have pregenerated `.pb.go` files generate with the appropriate configuration. The problem can be avoided by configuring Gazelle to not generate new proto rules, but instead use pre-existing `.pb.go` files. For reference the field number is set in [go-proto-validators](https://github.com/mwitkow/go-proto-validators/blob/32a686adf8b5194d3ea07d632d49b6fb344af678/validator.proto#L19) which is an indirect dependency through protoc-gen-doc. In this case we need to update protoc-gen-validate to v0.6.2 to include bufbuild/protoc-gen-validate@4f41f10 which fixes unknown label errors. * ./fmt * Expose gRPC status.proto for Haskell bindings * Update Gazelle to support embedsrcs on Windows `protoc-gen-doc` relies on `go:embed` file embedding https://github.com/pseudomuto/protoc-gen-doc/blob/2dde01902b28e8b2201d935467bc4308ec912255/resources.go#L8. Gazelle supports `embedsrcs`, however, it did not generate the attribute correctly on Windows due to the different directory separator. This is fixed in bazel-contrib/bazel-gazelle#1101. * Add gazelle to compatibility workspace It's loaded into `@daml`'s top-level `BUILD` file and ends up being a dependency of the compatibility workspace as well. * shift go_googleapis import * Delete dead code protobuf is imported transitively. * Document how to add Go dependencies Co-authored-by: Moritz Kiefer <[email protected]> Co-authored-by: Andreas Herrmann <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current version of protoc-gen-doc we're using (
1.1
) doesn't support renderingoneof
types. This was fixed in protoc-gen-doc1.4
or later.The
oneof
in commands.proto is currently rendered like this:The text was updated successfully, but these errors were encountered: