SerializationException when testing API Gateway through Postman

11 Views Asked by At

I have an API gateway triggering state machine and the payload looks like this:

{
  "account_id": "00000000000",
  "account_alias": "aws-testing",
  "environment": "dev",
  "role_x": "arn:aws:iam::00000000000:role/abc-abc",
  "role_y": "arn:aws:iam::00000000000:role/xyz-xyz",
  "date": "mmddyy"
}

I was getting SerializationException error in api console when I tested it. After going through the stack overflow post, I fixed the mapping template and when I test in console, its working properly. But when I test from the postman I am getting the below error.

{
"__type": "com.amazon.coral.service#SerializationException"
}

My mapping template looks like this:

              #set($input = $input.json('$'))
              {
                "input": "$util.escapeJavaScript($input).replaceAll("\\'", "'")",
                "stateMachineArn": "arn:aws:states:region:1111111111:stateMachine:testing"
              }

I am getting error through postman and not through console testing. Is it different when we test from console and from postman? Does postman formats the body?

0

There are 0 best solutions below