Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Version of buf.build/bufbuild/protovalidate to use.
protovalidate.version = v0.14.2
protovalidate.version = v1.0.0

# Arguments to the protovalidate-conformance CLI
protovalidate.conformance.args = --strict_message --strict_error --expected_failures=expected-failures.yaml
Expand Down
13 changes: 10 additions & 3 deletions src/main/resources/buf/validate/validate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ message FieldRules {
// the fields are set and valid.
//
// Fields that don't track presence are always validated by Protovalidate,
// whether they are set or not. It is not necessary to add `required`:
// whether they are set or not. It is not necessary to add `required`. It
// can be added to indicate that the field cannot be the zero value.
//
// ```proto
// syntax="proto3";
Expand All @@ -254,9 +255,14 @@ message FieldRules {
// (buf.validate.field).string.email = true
// ];
// // `repeated.min_items` always applies, even to an empty list.
// repeated string labels = 4 [
// repeated string labels = 2 [
// (buf.validate.field).repeated.min_items = 1
// ];
// // `required`, for fields that don't track presence, indicates
// // the value of the field can't be the zero value.
// int32 zero_value_not_allowed = 3 [
// (buf.validate.field).required = true
// ];
// }
// ```
//
Expand Down Expand Up @@ -419,7 +425,8 @@ enum Ignore {
// // The field's rules will always be ignored, including any validations
// // on value's fields.
// MyOtherMessage value = 1 [
// (buf.validate.field).ignore = IGNORE_ALWAYS];
// (buf.validate.field).ignore = IGNORE_ALWAYS
// ];
// }
// ```
IGNORE_ALWAYS = 3;
Expand Down