buf icon indicating copy to clipboard operation
buf copied to clipboard

Add a check for `required` to `PROTOVALIDATE` lint rule for repeated and map key/values

Open doriable opened this issue 7 months ago • 0 comments

Feature

If someone sets required on repeated field rules or map key/value field rules, e.g.

message Foo {
  map<string, int> map_example = 1 [(buf.validate.field).map.keys.required = true];
  repeated string repeated_example = 2 [(buf.validate.field).repeated.required = true];
}

These are unenforceable constraints/no-ops for protovalidate. As a part of the lint rule, we should surface these to the user.

doriable avatar May 02 '25 20:05 doriable