protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Fix JSON encoding of proto3 optional non-nil defaults

Open zookzook opened this issue 9 months ago • 0 comments

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.

zookzook avatar Sep 19 '23 07:09 zookzook