From d29fb4c5720b1cae856a5ef1ecebfbe399b8e8fe Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Wed, 18 Dec 2024 09:25:55 -0500 Subject: [PATCH] Fix README cel expression Matches [`protovalidate-go`'s usage](https://github.com/bufbuild/protovalidate-go?tab=readme-ov-file#usage). Fixes #229. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e9835998..c01515a6 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ message Transaction { string price = 4 [(buf.validate.field).cel = { id: "transaction.price", message: "price must be positive and include a valid currency symbol ($ or £)", - expression: "(this.startswith('$') or this.startswith('£')) and float(this[1:]) > 0" + expression: "(this.startsWith('$') || this.startsWith('£')) && double(this.substring(1)) > 0" }]; option (buf.validate.message).cel = {