How to use Request Templates in API Gateway Websocket Integration?

0

I cannot get the Velocity RequestTemplates in my Websocket API integration to transform my input before sending my request to the integration.

Specifically I have created an AWS integration to Step Functions and need to transform the request to be {"input": { actual input }, "stateMachineArn": "arn of statemachine"}

I have tested with wscat specifying --header "Content-Type: application: json". My Request Template is mapped to "application/json". The CloudWatch logs for the Stage show the connection with the Content-Type header correct and also shows the routed request being routed properly. But the input before and after mapping is the same, so the Step Functions StartExecution call is returning 400.

Using the aws apigatewayv2 get-integrations I can confirm the RequestTemplates is set properly.

What is a simple of example of a Websocket API using RequestTemplates properly?

mjans71
已提问 1 年前95 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则