aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/field_mask.proto
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/field_mask.proto')
-rw-r--r--src/google/protobuf/field_mask.proto45
1 files changed, 19 insertions, 26 deletions
diff --git a/src/google/protobuf/field_mask.proto b/src/google/protobuf/field_mask.proto
index 76e09f39..4015b1a3 100644
--- a/src/google/protobuf/field_mask.proto
+++ b/src/google/protobuf/field_mask.proto
@@ -38,6 +38,7 @@ option java_outer_classname = "FieldMaskProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask";
+option cc_enable_arenas = true;
// `FieldMask` represents a set of symbolic field paths, for example:
//
@@ -107,57 +108,49 @@ option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask";
// 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, the existing
-// repeated values in the target resource will be overwritten by the new values.
-// Note that a repeated field is only allowed in the last position of a `paths`
-// string.
+// 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 the existing sub-message in the target resource is
-// overwritten. Given the target message:
+// 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
+// d: 1
+// x: 2
// }
-// c : 1
+// c: [1]
// }
//
// And an update message:
//
// f {
// b {
-// d : 10
+// d: 10
// }
+// c: [2]
// }
//
// then if the field mask is:
//
-// paths: "f.b"
+// paths: ["f.b", "f.c"]
//
// then the result will be:
//
// f {
// b {
-// d : 10
+// d: 10
+// x: 2
// }
-// c : 1
+// c: [1, 2]
// }
//
-// However, if the update mask was:
-//
-// paths: "f.b.d"
-//
-// then the result would be:
-//
-// f {
-// b {
-// d : 10
-// x : 2
-// }
-// c : 1
-// }
+// An implementation may provide options to override this default behavior for
+// repeated and message fields.
//
// In order to reset a field's value to the default, the field must
// be in the mask and set to the default value in the provided resource.