Open lambdaxdotx opened 3 weeks ago
Please note that active development of the ocaml-protoc-plugin
has moved to https://github.com/andersfugmann/ocaml-protoc-plugin. I have replied to your question here: https://github.com/andersfugmann/ocaml-protoc-plugin/issues/42.
Hi, Thanks for your work on this project.
This is a feature request more than an actual issue.
tldr: Would it be possible to modify the OCaml generation to optionally emit a single OCaml module for all messages in a
.proto
file rather than a separate module for each of the messages?A more reasoned request follows. Messages can be structured to follow a hierarchy, as in this example:
Especially in such cases, it would be useful to optionally have in output just an OCaml module with a type mirroring such a hierarchy, approximately of the form:
Such an OCaml type hierarchy allows for easier navigation of the type structure than the current one. In particular, it would be easier to write a
ppx
for doing something on such a solution than the current one.Does this sound reasonable? How hard would it be to make such a change?