Open mousimin opened 9 months ago
Hm, I don't think so. There might be a bug here, but I'd appreciate if you could dig around a bit to find out. Perhaps this could be a doc contribution or a bug fix, or both :).
For anyone else that lands here, one way to work around this is to specify a field behavior. updated example from above:
message GetTokenRequest {
string hostname = 1 [(buf.validate.field).required = true, (buf.validate.field).string.hostname = true ];
repeated string buckets = 2 [(google.api.field_behavior) = REQUIRED];
}
📚 Documentation
I have a simple proto file:
And I want to add an extra openapi file to help to generate the swagger file:
After run "buf generate proto" command, I found the hostname field was marked as required, but the buckets field was not, do we have a document which describes how to config an array field as required? The generated swagger file: