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

Doesn't convert ZERO value of enum and False of boolean #11

Open
dakzh opened this issue May 26, 2016 · 4 comments
Open

Doesn't convert ZERO value of enum and False of boolean #11

dakzh opened this issue May 26, 2016 · 4 comments

Comments

@dakzh
Copy link

dakzh commented May 26, 2016

enum SomeType {
ZERO_VALUE = 0;
ONE_VALUE = 1;
}

message Test {
SomeType type = 1;
bool is_test = 2;
}

If we try to covert Test object with values SomeType.ZERO_VALUE and is_test is false from protobuf, then our dict will be empty

@Sergii-Makarevych
Copy link

Right. Same issue here with False values - output dict does not contain this field.

@aalba6675
Copy link

May be a low level protobuf issue: if you just

print(pb_my_message)

enum members of value 0 also don't show up.

Also MessageToJson(pb_my_message) also won't have keys whose value is 0. It's weird.

@Sergii-Makarevych
Copy link

It does show up. But missed after protobuf_to_dict method

@jclosure
Copy link

jclosure commented Feb 6, 2021

+1 same issue still in the go forward fork: https://github.com/kaporzhu/protobuf-to-dict. We should fix this, because it makes the dictionary output not fully representative of a protobuf.

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

4 participants