Skip to content

Commit 06f039c

Browse files
authored
Update to protovalidate v1.0.0 (#347)
Update to [upstream v1.0.0](https://github.com/bufbuild/protovalidate/releases/tag/v1.0.0).
1 parent cf0c066 commit 06f039c

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Version of buf.build/bufbuild/protovalidate to use.
2-
protovalidate.version = v0.14.2
2+
protovalidate.version = v1.0.0
33

44
# Arguments to the protovalidate-conformance CLI
55
protovalidate.conformance.args = --strict_message --strict_error --expected_failures=expected-failures.yaml

src/main/resources/buf/validate/validate.proto

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ message FieldRules {
243243
// the fields are set and valid.
244244
//
245245
// Fields that don't track presence are always validated by Protovalidate,
246-
// whether they are set or not. It is not necessary to add `required`:
246+
// whether they are set or not. It is not necessary to add `required`. It
247+
// can be added to indicate that the field cannot be the zero value.
247248
//
248249
// ```proto
249250
// syntax="proto3";
@@ -254,9 +255,14 @@ message FieldRules {
254255
// (buf.validate.field).string.email = true
255256
// ];
256257
// // `repeated.min_items` always applies, even to an empty list.
257-
// repeated string labels = 4 [
258+
// repeated string labels = 2 [
258259
// (buf.validate.field).repeated.min_items = 1
259260
// ];
261+
// // `required`, for fields that don't track presence, indicates
262+
// // the value of the field can't be the zero value.
263+
// int32 zero_value_not_allowed = 3 [
264+
// (buf.validate.field).required = true
265+
// ];
260266
// }
261267
// ```
262268
//
@@ -419,7 +425,8 @@ enum Ignore {
419425
// // The field's rules will always be ignored, including any validations
420426
// // on value's fields.
421427
// MyOtherMessage value = 1 [
422-
// (buf.validate.field).ignore = IGNORE_ALWAYS];
428+
// (buf.validate.field).ignore = IGNORE_ALWAYS
429+
// ];
423430
// }
424431
// ```
425432
IGNORE_ALWAYS = 3;

0 commit comments

Comments
 (0)