protobuf
protobuf copied to clipboard
Use .proto comments as @moduledoc for generated schemas
I would like to have my generated files show up in documentation. In my case, I am publishing a private hex package that we use to distribute the generated pb files amongst different Elixir services in our organization. For my case, I just want to documentation to show what the module names are. We don't need any more detail than that.
@supersimple this is on our radar and has been for a while. See https://github.com/elixir-protobuf/protobuf/pull/123. At the time we decided to postpone this but I'd be okay adding it, it seems like it's a desired feature for multiple users of the library.
Todd, any chance you'd have some time to work on this? I can work on this but in a couple weeks at best, using all my cycles now for https://github.com/lexhide/xandra.
@whatyouhide i might have some time.
I was just hoping for a flag to remove the @moduledoc: false
so I could see the module names in docs. It looks like that PR wants to provide a binary for the documentation.
Would it be okay to send up a PR for just the first part? or would you rather support that binary option?
Starting with an option to just disable @moduledoc: false
sounds fine with me as long as it can be extended in the future to include the moduledoc string.
@supersimple ping? 🙃
@supersimple ping? 🙃
Sorry, Andrea. My life exploded on me and I never got to this.
Hello from 2023! I'd love this functionality.
As an example, Temporal has detailed comments in their protobuf definitions: https://github.com/temporalio/api/blob/master/temporal/api/common/v1/message.proto
The produced Elixir code: https://github.com/mruoss/temporalio.ex/blob/main/lib/temporal/api/common/v1/message.pb.ex
Although protobuf doesn't specify what should happen to comments, that information seems to be available?
@btkostner seems to have a working implementation; the PR just needs code reviews. 😄