proteus
proteus copied to clipboard
Don't inline fields of embedded messages, keep them as separated messages
Right now, if we do something like the following:
type Model struct {
ID int64
}
type User struct {
Model
Name string
}
The result of the proto generated by proteus is:
message User {
int64 id = 1;
string name = 2;
}
Which works fine right now, but we should maybe change it because as a result, Model is not generated and does not get its ProtoMessage and all the mumbo jumbo it should have generated for it, which can be a mess for reflection-based marshal/unmarshal if we finally make it work with that.
Right now it works, but we should evaluate if this is worth fixing/changing or not in the long run.
If done, would be a breaking change, thus I would say we should add a tag to that field not to be treated as inlined.