You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This implements #428.
I might require some help regarding the test suites. Let me know what
you think.
Signed-off-by: Christoph Hoopmann <[email protected]>
// // The `value` FieldMask must only contain paths listed in `in`.
4663
+
// google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {
4664
+
// in: ["a", "b", "c.a"]
4665
+
// }];
4666
+
// }
4667
+
// ```
4668
+
repeatedstringin=2 [(predefined).cel = {
4669
+
id: "field_mask.in"
4670
+
expression: "!this.paths.all(p, p in getField(rules, 'in') || getField(rules, 'in').exists(f, p.startsWith(f+'.'))) ? 'value must only contain paths in %s'.format([getField(rules, 'in')]) : ''"
4671
+
}];
4672
+
4673
+
// `not_in` requires the field value to not contain paths matching specified
4674
+
// values or their subpaths.
4675
+
// If any of the field value's paths matches the rule,
// // The `value` FieldMask shall not contain paths listed in `not_in`.
4682
+
// google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {
4683
+
// not_in: ["forbidden", "immutable", "c.a"]
4684
+
// }];
4685
+
// }
4686
+
// ```
4687
+
repeatedstringnot_in=3 [(predefined).cel = {
4688
+
id: "field_mask.not_in"
4689
+
expression: "!this.paths.all(p, !(p in getField(rules, 'not_in') || getField(rules, 'not_in').exists(f, p.startsWith(f+'.')))) ? 'value must not contain any paths in %s'.format([getField(rules, 'not_in')]) : ''"
4690
+
}];
4691
+
4692
+
// `example` specifies values that the field may have. These values SHOULD
4693
+
// conform to other rules. `example` values will not impact validation
4694
+
// but may be used as helpful guidance on how to populate the given field.
// TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type.
4634
4723
messageTimestampRules {
4635
4724
// `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated.
0 commit comments