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?

Nessuna risposta

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande