Closed talksik closed 3 months ago
I believe I can add to the oneof field from number 10, but that seems like bad practice/don't even know if it's possible.
This is not only possible, this is the correct way to add another field to the oneof
if 9 is already used. There is no requirement that fields composing a oneof
be sequential, or even near each other in field numbers.
Thanks @puellanivis
Appreciate the clarity! 🙏
Supposed I started with this with the idea that I can keep adding fields to the
oneof
.So that when we want to add, we can do the following:
What if I want to add a field outside the oneof block. For instance, I want to add
updated_at
to the block top level.This ^ creates a bit of a pickle. Now I can't freely add to the oneof. I believe I can add to the oneof field from number 10, but that seems like bad practice/don't even know if it's possible.
I could also create another
message TopLevelProperties {}
so that those can continue to grow:But this seems like a workaround and I feel like I must be missing some design.