Skip to content

API Gateway Mapping Template missing toJson

0

API Gateway seems to have limited VTL support, and in particular 2 key features are missing that AppSync VTL does support - $util.toJson and #return. Are these on the roadmap or are there workarounds? I know I can always fall back to Lambda, but I'm specifically trying to do as much in the mapping template as possible.

1 Answer
0

Thank you for the feedback. We have a Feature request to add same utils functions that are available for AppSync in the API Gateway VTL https://docs.aws.amazon.com/appsync/latest/devguide/resolver-util-reference.html

I have added your voice to the feature request. Apologies for the delayed acknowledgement.

AWS
SUPPORT ENGINEER
answered 2 years ago
  • Hi! After hours of trial and error'ing I also found out that $util.toJson() was not actually working in API Gateway response templating. All guides I've found are always bound to AppSync, hence I assumed that those two used the same engine. Do you have any documentation on what is actually supported in API Gateway regarding VTL?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.