You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Protobuf supports a set of well known types (StringValue, Int64Value, ...) to support having optional primitive fields. When these fields are serialized to JSON, the wrapper message is skipped and the value is serialized directly.
I have been using this approach for other types as well, e.g. a URL type, a UUID type, and so on. It would be great if my own custom "wrapped" types could be JSON serialized in the same way well known types are serialized.
To support this, I am proposing to add an option to specify the WellKnownType of a message. When this option is set, the code generator will add the XXX_WellKnownType() string method to the type. The message will be required to have a single field named "value" with id 1.
The text was updated successfully, but these errors were encountered:
Protobuf supports a set of well known types (StringValue, Int64Value, ...) to support having optional primitive fields. When these fields are serialized to JSON, the wrapper message is skipped and the value is serialized directly.
I have been using this approach for other types as well, e.g. a URL type, a UUID type, and so on. It would be great if my own custom "wrapped" types could be JSON serialized in the same way well known types are serialized.
To support this, I am proposing to add an option to specify the WellKnownType of a message. When this option is set, the code generator will add the
XXX_WellKnownType() string
method to the type. The message will be required to have a single field named "value" with id 1.The text was updated successfully, but these errors were encountered: