@@ -150,17 +150,18 @@ message MessageRules {
150
150
// fields have explicit presence. This means that, for the purpose of determining
151
151
// how many fields are set, explicitly setting such a field to its zero value is
152
152
// effectively the same as not setting it at all.
153
- // 3. This will generate validation errors when unmarshalling, even from the binary
154
- // format. With a Protobuf oneof, if multiple fields are present in the serialized
155
- // form, earlier values are usually silently ignored when unmarshalling, with only
156
- // the last field being present when unmarshalling completes.
153
+ // 3. This will always generate validation errors for a message unmarshalled from
154
+ // serialized data that sets more than one field. With a Protobuf oneof, when
155
+ // multiple fields are present in the serialized form, earlier values are usually
156
+ // silently ignored when unmarshalling, with only the last field being set when
157
+ // unmarshalling completes.
157
158
//
158
159
//
159
160
// ```proto
160
161
// message MyMessage {
161
162
// // Only one of `field1` or `field2` _can_ be present in this message.
162
163
// option (buf.validate.message).oneof = { fields: ["field1", "field2"] };
163
- // // Only one of `field3` or `field4` _must_ be present in this message.
164
+ // // Exactly one of `field3` or `field4` _must_ be present in this message.
164
165
// option (buf.validate.message).oneof = { fields: ["field3", "field4"], required: true };
165
166
// string field1 = 1;
166
167
// bytes field2 = 2;
0 commit comments