protoc-gen-doc
protoc-gen-doc copied to clipboard
Add oneOf support
In our proto files we use the oneof
keyword and we have noticed that this is currently ignored in the generated outputs. Our documentation team would like to see oneof
support added to the tool.
To generate oneOf
support for the 0.96 release I had added the following QT code to the message
generation (line 346 onwards)
// Add basic info.
field["field_name"] = QString::fromStdString(fieldDescriptor->name());
field["field_description"] = description;
field["field_label"] = labelName(fieldDescriptor->label());
field["field_default_value"] = defaultValue(fieldDescriptor);
if (fieldDescriptor->containing_oneof()){
field["field_one_of"] = QString::fromStdString(fieldDescriptor->containing_oneof()->name());
field["field_one_of_description"] = descriptionOf(fieldDescriptor->containing_oneof(), excluded);
}
Since then I see that the code has been ported to GO, and I have another have been working on adding the equivalent code to the 1.0.0 release.
Would you like to examine a PR for making this happen?
Hey @jason-fox, I'd definitely be interested in a PR to add oneOf support!
I added my patches as base in the existing PR https://github.com/pseudomuto/protoc-gen-doc/pull/336 Didn't have time to do a proper PR and add tests. Sorry for that :(
any updates on this, is it going to get done at some point ?
https://gist.github.com/lambdalisue/1f5ec5ee66e66c51564ab0c6ab2e89ce
I've made a markdown template which support oneof
and optional
.
It would be excellent to have this.
any progress on this?
No resolution in five years. Closing.