protoyaml-go icon indicating copy to clipboard operation
protoyaml-go copied to clipboard

Add DiscardUnknown to UnmarshalOptions

Open bufdev opened this issue 1 year ago • 1 comments

Similar to:

It would be good to have a DiscardUnknown option on protoyaml.UnmarshalOptions.

https://github.com/bufbuild/buf/issues/2714 is the motivation for this issue.

bufdev avatar Jun 27 '24 19:06 bufdev

Ideally, protoyaml (and protojson and protobuf) would only ignore fields explicitly marked as 'ignore' instead of all unknown fields. This would allow the safe removal of old fields without risking uncaught typos (similar to how reserved fields ids keep track of old fields to avoid reuse). However, protoyaml should have this option for feature parity with protojson/buf.

Alfus avatar Aug 10 '24 13:08 Alfus