FieldMaskRules describe rules applied exclusively to the google.protobuf.FieldMask well-known type.
FieldMaskRules describe rules applied exclusively to the google.protobuf.FieldMask well-known type.
Optional[customReturns a safe value for JSON logs.
Returns a safe value for JSON logs.
Optional[unknownPreserves protobuf fields that this SDK version does not recognize.
Contains the fully qualified protobuf type name.
Optionalconstconst dictates that the field must match the specified value of the google.protobuf.FieldMask type exactly.
If the field's value deviates from the specified value, an error message
will be generated.
message MyFieldMask {
// value must equal ["a"]
google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = {
paths: ["a"]
}];
}
example specifies values that the field may have. These values SHOULD
conform to other rules. example values will not impact validation
but may be used as helpful guidance on how to populate the given field.
message MyFieldMask {
google.protobuf.FieldMask value = 1 [
(buf.validate.field).field_mask.example = { paths: ["a", "b"] },
(buf.validate.field).field_mask.example = { paths: ["c.a", "d"] },
];
}
in requires the field value to only contain paths matching specified
values or their subpaths.
If any of the field value's paths doesn't match the rule,
an error message is generated.
See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask
message MyFieldMask {
// The `value` FieldMask must only contain paths listed in `in`.
google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {
in: ["a", "b", "c.a"]
}];
}
not_in requires the field value to not contain paths matching specified
values or their subpaths.
If any of the field value's paths matches the rule,
an error message is generated.
See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask
message MyFieldMask {
// The `value` FieldMask shall not contain paths listed in `not_in`.
google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {
not_in: ["forbidden", "immutable", "c.a"]
}];
}
FieldMaskRules describe rules applied exclusively to the
google.protobuf.FieldMaskwell-known type.