It seems clear that default values are not being serialized. According to protobuf docs, fields marked with optional in proto3 should follow the explicit presence discipline which means:
Explicitly set values are always serialized, including default values.
I believe this should be fixed to conform to the specification.
I have the following schema:
When I generate code with
pb-rs
, I'm getting the following implementation ofwrite_message
:It seems clear that default values are not being serialized. According to protobuf docs, fields marked with
optional
in proto3 should follow the explicit presence discipline which means:I believe this should be fixed to conform to the specification.