@@ -243,7 +243,8 @@ message FieldRules {
243243 // the fields are set and valid.
244244 //
245245 // Fields that don't track presence are always validated by Protovalidate,
246- // whether they are set or not. It is not necessary to add `required`:
246+ // whether they are set or not. It is not necessary to add `required`. It
247+ // can be added to indicate that the field cannot be the zero value.
247248 //
248249 // ```proto
249250 // syntax="proto3";
@@ -254,9 +255,14 @@ message FieldRules {
254255 // (buf.validate.field).string.email = true
255256 // ];
256257 // // `repeated.min_items` always applies, even to an empty list.
257- // repeated string labels = 4 [
258+ // repeated string labels = 2 [
258259 // (buf.validate.field).repeated.min_items = 1
259260 // ];
261+ // // `required`, for fields that don't track presence, indicates
262+ // // the value of the field can't be the zero value.
263+ // int32 zero_value_not_allowed = 3 [
264+ // (buf.validate.field).required = true
265+ // ];
260266 // }
261267 // ```
262268 //
@@ -419,7 +425,8 @@ enum Ignore {
419425 // // The field's rules will always be ignored, including any validations
420426 // // on value's fields.
421427 // MyOtherMessage value = 1 [
422- // (buf.validate.field).ignore = IGNORE_ALWAYS];
428+ // (buf.validate.field).ignore = IGNORE_ALWAYS
429+ // ];
423430 // }
424431 // ```
425432 IGNORE_ALWAYS = 3 ;
0 commit comments