protobuf
protobuf copied to clipboard
Fix JSON encoding of proto3 optional non-nil defaults
It fixes the same issue but now for the JSON encoder like https://github.com/elixir-protobuf/protobuf/pull/302
Currently with proto3 optional values, a zero/default value is skipped. This means that the JSON decode(encode(msg))
is not the same for all messages with proto3 optional fields.
This PR ensures that attributes containing the default values are not skipped for proto3_optional fields.