Skip to content
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

Add oneOf support #333

Closed
jason-fox opened this issue Jan 3, 2018 · 7 comments
Closed

Add oneOf support #333

jason-fox opened this issue Jan 3, 2018 · 7 comments

Comments

@jason-fox
Copy link

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?

@pseudomuto
Copy link
Owner

Hey @jason-fox, I'd definitely be interested in a PR to add oneOf support!

@Falco20019
Copy link

I added my patches as base in the existing PR #336 Didn't have time to do a proper PR and add tests. Sorry for that :(

@jorgheymans
Copy link

any updates on this, is it going to get done at some point ?

@lambdalisue
Copy link

https://gist.github.com/lambdalisue/1f5ec5ee66e66c51564ab0c6ab2e89ce

I've made a markdown template which support oneof and optional.

@amrhassan
Copy link

It would be excellent to have this.

@marcosrmendezthd
Copy link

any progress on this?

@jason-fox
Copy link
Author

No resolution in five years. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants