From d97d40df8810c72e70db8665f1c18424218017ff Mon Sep 17 00:00:00 2001 From: Nick Snyder Date: Tue, 14 Nov 2023 10:01:01 -0800 Subject: [PATCH] Document correct option syntax --- proto/protovalidate/buf/validate/validate.proto | 4 ++-- tools/internal/gen/buf/validate/validate.pb.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/proto/protovalidate/buf/validate/validate.proto b/proto/protovalidate/buf/validate/validate.proto index 35d65b76..6d11ea6b 100644 --- a/proto/protovalidate/buf/validate/validate.proto +++ b/proto/protovalidate/buf/validate/validate.proto @@ -3249,7 +3249,7 @@ message EnumRules { // // message MyMessage { // // The field `value` must be equal to one of the specified values. - // MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + // MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; // } // ``` repeated int32 in = 3 [(priv.field).cel = { @@ -3270,7 +3270,7 @@ message EnumRules { // // message MyMessage { // // The field `value` must not be equal to any of the specified values. - // MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + // MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; // } // ``` repeated int32 not_in = 4 [(priv.field).cel = { diff --git a/tools/internal/gen/buf/validate/validate.pb.go b/tools/internal/gen/buf/validate/validate.pb.go index 3e5b7af5..c9b361c2 100644 --- a/tools/internal/gen/buf/validate/validate.pb.go +++ b/tools/internal/gen/buf/validate/validate.pb.go @@ -4929,7 +4929,7 @@ type EnumRules struct { // // message MyMessage { // // The field `value` must be equal to one of the specified values. - // MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + // MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; // } // // ``` @@ -4948,7 +4948,7 @@ type EnumRules struct { // // message MyMessage { // // The field `value` must not be equal to any of the specified values. - // MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + // MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; // } // // ```