Skip to content

Commit d29fb4c

Browse files
Fix README cel expression
Matches [`protovalidate-go`'s usage](https://github.com/bufbuild/protovalidate-go?tab=readme-ov-file#usage). Fixes #229.
1 parent 9fc35f1 commit d29fb4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ message Transaction {
6767
string price = 4 [(buf.validate.field).cel = {
6868
id: "transaction.price",
6969
message: "price must be positive and include a valid currency symbol ($ or £)",
70-
expression: "(this.startswith('$') or this.startswith('£')) and float(this[1:]) > 0"
70+
expression: "(this.startsWith('$') || this.startsWith('£')) && double(this.substring(1)) > 0"
7171
}];
7272
7373
option (buf.validate.message).cel = {

0 commit comments

Comments
 (0)