How to persuade GetProto to spit out proto3 format

74 views Asked by At

Using the excellent ProtobufNet by Marc Gravell, we are able to maintain our types in C# and then export them to .proto files for conversion into all the languages needed by our clients.

However we would like to use the proto3 protocol format which is much simpler and less error prone than proto2 which seems to be standard.

After looking around the net we found this encouraging post from the author that seems to indicate that there is proto3 support: https://github.com/mgravell/protobuf-net/issues/187

However we have not found any documentation for ProtobufNet, and so it is a bit difficult to know how to pull this off. So the question is, how can we have GetProto generate proto3 compatible output for our decorated C# types?

1

There are 1 answers

0
Marc Gravell On BEST ANSWER

In the current versions there is an optional parameter (technically an overload) that defines the schema version. I think it might even default to proto3.

So... just update? Or worst case: update and specify the optional parameter to GetProto.