Can an object serialized with protobuf-net in c# be deserialized with python by generating a .proto file?

Viewed 164

The issue is that the producer of the data does not have a .proto definition and just has the .cs files.

From looking at other questions it seems it is possible but is there a tool to convert the .cs protobuf-net definition to a .proto file so I can use the file to deserialize in python?

1 Answers
string proto = Serializer.GetProto<YourRootType>();

Note that if you're using DateTime or TimeSpan, you should ideally use DataFormat.WellKnown - to use Timestamp and Duration respectively - however, this is a breaking change to your existing data (this is done via the [ProtoMember(...)])

Related