e-nouri
e-nouri

Reputation: 2626

Valid Json in Mapping Templates API Gateway

I am working with AWS API Gateway and Lambda, I am trying to passe a valid Json object to the Lambda function to avoid sanitizing the data in the function. Using this code:

"params" : "$input.params()",

will result in this data being sent to the Lambda function:

"params" : "{path={}, querystring={src_build=rfsdfsdf}, header={}}",

Is there a solution get the $input.params as a valide json dictionary ?

Upvotes: 5

Views: 2367

Answers (1)

adamkonrad
adamkonrad

Reputation: 7122

The answer may be just $input.json('$').

enter image description here

I based this answer on information from API Gateway Developer Guide.

Upvotes: 2

Related Questions