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

group support #106

Closed
dweinstein opened this issue May 16, 2017 · 7 comments
Closed

group support #106

dweinstein opened this issue May 16, 2017 · 7 comments

Comments

@dweinstein
Copy link

@tomas-abrahamsson,

many (albeit internal) google APIs use the deprecated groups feature in protobuf definitions. is there any feeling against supporting this deprecated feature of protobuf? Would it be difficult to introduce support in gpb, or would it introduce other issues that would impact the current functionality? Thanks...

@tomas-abrahamsson
Copy link
Owner

I'll look into it

@tomas-abrahamsson
Copy link
Owner

FYI: I think I'm going to do it like this: If we have a message like this

message m1 {
  required group g = 2 {
    required uint32 gf = 3;
  }
}

...then the name of group will be 'm1.m1_g', and there will be a message "invented" for it. The name will not be m1_g because that could possibly collide with some other message definition. Naming it 'm1.m1_g' is safer, I think.

On technical details, I think I will make the internal structure be {{group,Name},Fields} and the field type for such a group (field type for the field g in the example) will be {group,Name}. (The internal structure is exposed via the to_proto_defs compilation option.)

It is not carved in stone yet, I might change my mind later, but for now, I think this is how it will look.

@dweinstein
Copy link
Author

sounds a little like protobufjs/protobuf.js#568 (comment)

@tomas-abrahamsson
Copy link
Owner

Yes, similar

@tomas-abrahamsson
Copy link
Owner

Hi, I've just pushed a branch, groups if you want to try it out. Let me know how it works for you, and I can merge it to master. Still missing on this branch is nif support, but I can add that later.

I changed my mind about naming, so the group in the previous example would be just 'm1.g' not 'm1.m1_g'. As I learned more while implementing groups, I no longer think there's any risk of naming collision.

@tomas-abrahamsson
Copy link
Owner

Nif-support is now added, and the branch has been force-pushed. I plan to merge it to master within not too long.

@tomas-abrahamsson
Copy link
Owner

Support for groups is now included in 3.27.0.

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

2 participants