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
demandé il y a un an95 vues
Aucune réponse

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions