E.g.
import os
os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python"
import proto
class Squid(proto.Message):
massKg = proto.Field(proto.INT32, number=1, json_name="mass_in_kilograms")
s = Squid(massKg=20)
j = Squid.to_json(s)
print(j) # '{"massKg" : 20}', or something like that.
This is only reproducible with the python protobuf implementation.
Editorial: my gut feeling is that this is a bug in proto-plus, or at least that a workaround/fix/correct solution is entirely possible within proto-plus.
E.g.
This is only reproducible with the python protobuf implementation.
Editorial: my gut feeling is that this is a bug in proto-plus, or at least that a workaround/fix/correct solution is entirely possible within proto-plus.