TDD or not to Be

Developers journey to clean code.

Modifing AWS Gateway Output Parameters

| Comments

Maybe you want to hide unnecessery parameters from api or you want to modify the keys. It’s straightforawrd with amazon gateway but it took me some time to find how to do it. Go to AWS Gateway -> Your api -> Integration Response -> Response template and change “passthru” to sth like

1
2
3
4
#set($inputRoot = $input.path('$'))
{
  "listings" : $inputRoot.items
  }

This will strip all other keys in a response dict and replace it with one key that’s the value of original ‘items’ key. Whoila!

Comments