Files
floci/src/main/java
Tyler Webb aff365d1e5 fix(apigateway): register the $foreach loop scope for native VTL (#7859)
In the native image every $foreach property of a VTL mapping template
resolved to null: #if($foreach.hasNext) was always false, so the usual
comma-between-items pattern rendered invalid JSON, and $foreach.index,
$foreach.count and $foreach.hasNext printed as literal text. Velocity
binds $foreach to a ForeachScope and reads its getters through
reflection, but only the Foreach directive was registered, not the scope
it creates. Velocity then fell back to reading the scope as a map, which
holds none of those keys.

ForeachScope and its parent Scope are now registered alongside the
directive. Reflection registration covers the whole image, so AppSync
resolver templates, which loop through the same directive, get the
scope too.
2026-11-10 08:06:42 -04:00
..