Skip to content

Commit 69cd718

Browse files
authored
Update Protovalidate examples for the Extension Registry (#158)
1 parent e737e8c commit 69cd718

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ spark-warehouse
4848

4949
*/quickstart-java/**/bin
5050
*/grpc-java/**/bin
51+
*/quickstart-python/*/.venv
52+
*/grpc-python/*/.venv

protovalidate/rules-predefined/additional-examples/long-and-short/additional-examples/rules-edition-2023/proto/bufbuild/people/v1/predefined_string_rules.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ import "buf/validate/validate.proto";
2020

2121
// @BufCode{"start": "Defining rules"}
2222
extend buf.validate.StringRules {
23-
bool long_name_component = 81048952 [(buf.validate.predefined).cel = {
23+
bool long_name_component = 10000 [(buf.validate.predefined).cel = {
2424
id: "string.long_name_component"
2525
message: "value must have between 1 and 50 characters"
2626
expression: "this.size() > 0 && this.size() <= 50"
2727
}];
28-
bool short_name_component = 81048953 [(buf.validate.predefined).cel = {
29-
id: "string.long_name_component"
28+
bool short_name_component = 10001 [(buf.validate.predefined).cel = {
29+
id: "string.short_name_component"
3030
message: "value must have between 1 and 25 characters"
3131
expression: "this.size() > 0 && this.size() <= 25"
3232
}];

protovalidate/rules-predefined/additional-examples/long-and-short/proto/bufbuild/people/v1/predefined_string_rules.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ import "buf/validate/validate.proto";
2020

2121
// @BufCode{"start": "Defining rules"}
2222
extend buf.validate.StringRules {
23-
optional bool long_name_component = 81048952 [(buf.validate.predefined).cel = {
23+
optional bool long_name_component = 10000 [(buf.validate.predefined).cel = {
2424
id: "string.long_name_component"
2525
message: "value must have between 1 and 50 characters"
2626
expression: "this.size() > 0 && this.size() <= 50"
2727
}];
28-
optional bool short_name_component = 81048953 [(buf.validate.predefined).cel = {
29-
id: "string.long_name_component"
28+
optional bool short_name_component = 10001 [(buf.validate.predefined).cel = {
29+
id: "string.short_name_component"
3030
message: "value must have between 1 and 25 characters"
3131
expression: "this.size() > 0 && this.size() <= 25"
3232
}];

protovalidate/rules-predefined/additional-examples/resolving-conflicts/proto/bufbuild/people/v1/predefined_string_rules.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import "buf/validate/validate.proto";
2020

2121
// @BufCode{"start": "Resolving conflicts in a rule"}
2222
extend buf.validate.StringRules {
23-
optional int32 name_component = 80048954 [(buf.validate.predefined).cel = {
23+
optional int32 name_component = 10002 [(buf.validate.predefined).cel = {
2424
id: "string.name_component"
2525
expression:
2626
"("

protovalidate/rules-predefined/proto/bufbuild/people/v1/predefined_string_rules.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import "buf/validate/validate.proto";
2020

2121
// @BufCode{"start": "Using rule values"}
2222
extend buf.validate.StringRules {
23-
optional int32 name_component = 80048954 [(buf.validate.predefined).cel = {
23+
optional int32 name_component = 10002 [(buf.validate.predefined).cel = {
2424
id: "string.name_component"
2525
expression:
2626
"(this.size() > 0 && this.size() <= rule)"

0 commit comments

Comments
 (0)