Skip to content

Commit 0f01af2

Browse files
committed
docs: note that ComparisonExpr always quotes values
1 parent 2fc8ae6 commit 0f01af2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

internal/policy/expression.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ func ExistsExpr(context string) string {
4747
}
4848

4949
// ComparisonExpr returns a policy expression comparing a context field to a value.
50+
// The value is always quoted as a string. For operators like > or <, the policy
51+
// engine must handle string-to-numeric coercion if needed.
5052
func ComparisonExpr(context, op, value string) string {
5153
return fmt.Sprintf(`${{ %s %s "%s" }}`, context, op, value)
5254
}

0 commit comments

Comments
 (0)