Files
floci/src
Priamo Germosen 7a228c5325 refactor(apigateway,appsync): extract shared VTL $util functions into a common utility (#3583)
VtlTemplateEngine.UtilVariable (API Gateway) and AppSyncUtil (AppSync) each
independently implemented the same ~49-line block of AWS $util VTL functions
(escapeJavaScript, urlEncode, urlDecode, base64Encode, base64Decode, parseJson),
flagged as duplicated by CPD. AWS specifies $util identically across both services'
VTL mapping-template docs, so the two floci implementations risked silently
disagreeing on edge cases over time.

Extracted the shared functions into VtlUtilFunctions under core.common.vtl; both
$util implementations now delegate to it. base64Encode keeps two overloads
matching each service's real AWS signature: API Gateway's $util.base64Encode takes
a string, AppSync's takes a Blob (byte[] in the Java model), so both overloads are
preserved rather than collapsed into one.

No behavior change. All existing VtlTemplateEngine and AppSyncUtil tests, plus the
full ApiGateway and AppSync suites, pass unchanged.
2026-09-13 21:18:43 -05:00
..