Open dakzh opened 8 years ago
Right. Same issue here with False values - output dict does not contain this field.
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.
It does show up. But missed after protobuf_to_dict method
+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.
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