Re: [protobuf] Protobuf 3 optional vs FieldMasks

2023-01-18 Thread Jeff Sawatzky
After much trial and error, I've come to the conclusion that FieldMasks are still required if your resource has repeated or map fields. These can not be marked as optional and have no ability to check for presence. So in these cases you need a FieldMask, and in order to remain consistent in

Re: [protobuf] Protobuf 3 optional vs FieldMasks

2022-11-03 Thread 'Adam Cozzette' via Protocol Buffers
>From a protobuf perspective, either approach should work, so I think it is mostly a matter of preference. I think you are right that FieldMasks predate proto3 optional fields and were originally designed to accommodate the lack of optional fields in proto3. Now that proto3 has optional fields,

[protobuf] Protobuf 3 optional vs FieldMasks

2022-11-02 Thread Jeff Sawatzky
Now that protocol buffers 3 has support for optional fields which lets you test whether the field was set or not, are FieldMasks still useful? For instance, when implementing an Update method in gRPC which allows the client to update only the