From 3d106ee13ba277d4c8c770cdd786c93e1eafb937 Mon Sep 17 00:00:00 2001 From: jamesread Date: Mon, 12 Jan 2026 00:10:40 +0000 Subject: [PATCH] fix: JSON string marshalling in webhook uses raw strings --- service/internal/webhooks/jsonpath.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/service/internal/webhooks/jsonpath.go b/service/internal/webhooks/jsonpath.go index 7fc5309..8e51b70 100644 --- a/service/internal/webhooks/jsonpath.go +++ b/service/internal/webhooks/jsonpath.go @@ -25,7 +25,12 @@ func (m *JSONMatcher) MatchPath(pathExpr string, expectedValue string) (bool, er return false, err } - // Marshal to JSON for consistent string representation + // For string values, compare directly without marshaling + if strValue, ok := value.(string); ok { + return strValue == expectedValue, nil + } + + // For non-string values, marshal to JSON for consistent string representation jsonBytes, err := json.Marshal(value) if err != nil { return false, fmt.Errorf("failed to marshal extracted value: %w", err)