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

MessageDyn: Do not omit zero values on fields containing oneof #660

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mingyuchi
Copy link

@mingyuchi mingyuchi commented Dec 5, 2022

Omitting zeros on singular fields only make sense if it's not in oneof
For example, omitting zero on the following oneof will make it ambiguous

message IntOrString {
  oneof int_or_string {
    int32 int = 1;
    string str = 2;
  }
}

if either int or str is zero, both of the fields will be missing.
Now it's not possible to know which field was originally filled

@SeongMinPark-devsisters

@stepancheg Hello, what do you think of this pr?

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

Successfully merging this pull request may close these issues.

2 participants