kignwill101
kignwill101

Reputation: 153

automatically generating protobuf annotated classes

Is there a way to automatically generate json_serialable annotations to protobuf generated classes? How it stands now i am not able to serialize json to dart protobuf generated classes and i want serialize to a json output from a golang based rest service.

Upvotes: 0

Views: 758

Answers (1)

Nate Bosch
Nate Bosch

Reputation: 10925

There is no way to accomplish this today. The build system, build_runner does not allow overwriting files so it isn't possible to programmatically insert these annotations into the protobuf generated code.

This would require either an option in the protobuf generator to change the serialization format, or another serialization framework built on top of protobuf that would understand their source and can generate the custom serialization required.

Upvotes: 2

Related Questions