The following block is the excerpt from google.protobuf.FieldMask.
// # Field Masks in Update Operations
//
// A field mask in update operations specifies which fields of the
// targeted resource are going to be updated. The API is required
// to only change the values of the fields as specified in the mask
// and leave the others untouched. If a resource is passed in to
// describe the updated values, the API ignores the values of all
// fields not covered by the mask.
//
// If a repeated field is specified for an update operation, new values will
// be appended to the existing repeated field in the target resource. Note
that
// a repeated field is only allowed in the last position of a `paths`
string.
//
// If a sub-message is specified in the last position of the field mask for
an
// update operation, then new value will be merged into the existing
sub-message
// in the target resource.
//
// For example, given the target message:
//
// f {
// b {
// d: 1
// x: 2
// }
// c: [1]
// }
//
// And an update message:
//
// f {
// b {
// d: 10
// }
// c: [2]
// }
//
// then if the field mask is:
//
// paths: ["f.b", "f.c"]
//
// then the result will be:
//
// f {
// b {
// d: 10
// x: 2
// }
// c: [1, 2]
// }
In the example, the field `f.b.x` is unchanged after merge. Is this behavior
possible in proto3? Because `f.b.x` is an integer and whether `f.b.x` is
absent
or is the zero value cannot be distinguished.
Thank you
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/protobuf/697c840d-38a4-47e1-be90-fb84f877cbc8%40googlegroups.com.