-
Notifications
You must be signed in to change notification settings - Fork 77
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
cannot access multiple field options of a field #64
Comments
Hi, just curious if this was ever looked at or resolved? |
I don't think so. message Check {
string field_1 = 1 [(main.rule1).type.one = "rule1.type.one", (main.rule1).type.two = "rule1.type.two"];
// issue
string field_2 = 2 [(main.rule2).type.one = "rule2.type.one", (main.rule2).type.two = "rule2.type.two"];
string field_3 = 3 [(main.rule2).type.two = "rule2.type.two", (main.rule2).type.one = "rule2.type.one"];
// solution
string field_4 = 4 [(main.rule2).type = {one: "rule2.type.one" two: "rule2.type.two"}];
string field_5 = 5 [(main.rule2).type = {two: "rule2.type.two" one: "rule2.type.one"}];
} Follow https://github.com/Shivam010/protoc-gen-sample/blob/master/check.proto#L7-L15 |
@Shivam010 Dude I only want to thank you because your sample repo helps me understand how to get options from messages. |
Happy that it was helpful for you! 🤗 |
Cannot access all the field options tagged in the field in proto, when the options are defined in
oneOf
typeSee: https://github.com/Shivam010/protoc-gen-sample
When using this:
where
rule1
andrule2
are 2 field options:the retrieved options are for fields are:
It turns out that in the case of
oneOf
a new message option is created each time. And hence, only second option value is received.The text was updated successfully, but these errors were encountered: