Skip to content

Commit

Permalink
Support cel c++'s 'nan' (#59)
Browse files Browse the repository at this point in the history
Note that .lowerAscii is an extension function
  • Loading branch information
Alfus authored Jul 21, 2023
1 parent 582df81 commit a1c7b6b
Show file tree
Hide file tree
Showing 2 changed files with 1,926 additions and 1,925 deletions.
4 changes: 2 additions & 2 deletions proto/protovalidate/buf/validate/validate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ message FloatRules {
// infinite or NaN, an error message is generated.
bool finite = 8 [(priv.field).cel = {
id: "float.finite",
expression: "this == 1.0/0.0 || this == -1.0/0.0 || string(this) == 'NaN' ? 'value must be finite' : ''",
expression: "this == 1.0/0.0 || this == -1.0/0.0 || string(this) in ['NaN', 'nan'] ? 'value must be finite' : ''",
}];
}

Expand Down Expand Up @@ -568,7 +568,7 @@ message DoubleRules {
// infinite or NaN, an error message is generated.
bool finite = 8 [(priv.field).cel = {
id: "double.finite",
expression: "this == 1.0/0.0 || this == -1.0/0.0 || string(this) == 'NaN' ? 'value must be finite' : ''",
expression: "this == 1.0/0.0 || this == -1.0/0.0 || string(this) in ['NaN', 'nan'] ? 'value must be finite' : ''",
}];
}

Expand Down
Loading

0 comments on commit a1c7b6b

Please sign in to comment.