Open judah opened 8 years ago
Update: as described in google/protobuf#272, the specification is changing to preserve unknown fields in proto3 as well as proto2. See also: https://docs.google.com/document/d/1KMRX-G91Aa-Y2FkEaHeeviLRRNblgIahbsk4wA14gRk/edit#heading=h.w8dtggryroj4
When we implement this behavior, we should follow the new spec.
This has been mostly done for unknown fields (but not enums), in #129.
There are a couple remaining edge cases:
discardUnknownFields
function doesn't act recursively (unlike other languages)
We should preserve unknown fields and enums in proto2 messages.
From the docs: https://developers.google.com/protocol-buffers/docs/proto
Also, enums with unknown values should be treated like unknown fields and preserved for reserialization. (Note that this behavior is proto2-only; #28 describes the desired behavior for proto3.)