protovalidate
protovalidate copied to clipboard
[Feature Request] Required validate options with buf lint
Feature description:
When run buf lint, can check if all fields has some protovalidate options. Especially for:
- string/bytes max length
- repeated/map max items
Problem it solves or use case:
This ensures that developers don't forget to write these options.
And also make sure these fields is not too long or has too many elements, which is important to ensure that system resources are not exhausted. For example:
For this API request message:
message BatchGetUserRequest {
repeated int64 user_ids = 1;
}
The maximum elements number of user_ids is required for system, or it may cause database resource exhaustion.
Proposed implementation or solution:
- Add a cli
protovalidate lintcommand to run standalone with custom config fileprotovalidate.yaml. - Integrate with
buf lintas a plugin.
Contribution:
If this proposal is accepted, I can do that.
Examples or references:
NO
Additional context:
NO