Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1327)

Unified Diff: third_party/protobuf/src/google/protobuf/field_mask.proto

Issue 2599263002: third_party/protobuf: Update to HEAD (f52e188fe4) (Closed)
Patch Set: Address comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/field_mask.proto
diff --git a/third_party/protobuf/src/google/protobuf/field_mask.proto b/third_party/protobuf/src/google/protobuf/field_mask.proto
index 6af6dbe89805963c66ae99be1b3affd0dcec8135..c68d247c8a478b56567590ff62c6fea8c3bac2cc 100644
--- a/third_party/protobuf/src/google/protobuf/field_mask.proto
+++ b/third_party/protobuf/src/google/protobuf/field_mask.proto
@@ -37,7 +37,7 @@ option java_package = "com.google.protobuf";
option java_outer_classname = "FieldMaskProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
-option java_generate_equals_and_hash = true;
+option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask";
// `FieldMask` represents a set of symbolic field paths, for example:
//
@@ -82,7 +82,7 @@ option java_generate_equals_and_hash = true;
// }
//
// A repeated field is not allowed except at the last position of a
-// field mask.
+// paths string.
//
// If a FieldMask object is not present in a get operation, the
// operation applies to all fields (as if a FieldMask of all fields
@@ -107,6 +107,58 @@ option java_generate_equals_and_hash = true;
// 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 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:
+//
+// f {
+// b {
+// d : 1
+// x : 2
+// }
+// c : 1
+// }
+//
+// And an update message:
+//
+// f {
+// b {
+// d : 10
+// }
+// }
+//
+// then if the field mask is:
+//
+// paths: "f.b"
+//
+// then the result will be:
+//
+// f {
+// b {
+// d : 10
+// }
+// c : 1
+// }
+//
+// However, if the update mask was:
+//
+// paths: "f.b.d"
+//
+// then the result would be:
+//
+// f {
+// b {
+// d : 10
+// x : 2
+// }
+// c : 1
+// }
+//
// 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.
// Hence, in order to reset all fields of a resource, provide a default

Powered by Google App Engine
This is Rietveld 408576698