Skip to content

Commit

Permalink
check empty string first
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversun9 committed Dec 20, 2023
1 parent 881cbd7 commit 20dec1d
Show file tree
Hide file tree
Showing 2 changed files with 526 additions and 526 deletions.
6 changes: 3 additions & 3 deletions proto/protovalidate/buf/validate/validate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3286,7 +3286,7 @@ message BytesRules {
(priv.field).cel = {
id: "bytes.ip",
message: "value must be a valid IP address",
expression: "this.size() == 4 || this.size() == 16 || this.size() == 0 ",
expression: "this.size() == 0 || this.size() == 4 || this.size() == 16",
},
(priv.field).cel = {
id: "bytes.ip_empty",
Expand All @@ -3308,7 +3308,7 @@ message BytesRules {
(priv.field).cel = {
id: "bytes.ipv4",
message: "value must be a valid IPv4 address",
expression: "this.size() == 4 || this.size() == 0",
expression: "this.size() == 0 || this.size() == 4",
},
(priv.field).cel = {
id: "bytes.ipv4_empty",
Expand All @@ -3329,7 +3329,7 @@ message BytesRules {
(priv.field).cel = {
id: "bytes.ipv6",
message: "value must be a valid IPv6 address",
expression: "this.size() == 16 || this.size() == 0"
expression: "this.size() == 0 || this.size() == 16"
},
(priv.field).cel = {
id: "bytes.ipv6_empty",
Expand Down
Loading

0 comments on commit 20dec1d

Please sign in to comment.