serverless-operations / serverless-apigateway-service-proxy

This Serverless Framewrok plugin supports the AWS service proxy integration feature of API Gateway.
261 stars 78 forks source link

SQS not able to specify headers in responseParameters #115

Open chuckthepiranha opened 3 years ago

chuckthepiranha commented 3 years ago

No matter what I do, my response shows up as application/json. I am able to change the method response model to application/xml in API Gateway manually and it works so I am assuming I would need to change something in my response parameters... Is there something I am doing wrong? When I try deploying I get this:

errors : [Invalid mapping expression specified: true, Invalid mapping expression specified: integration.response.header.Content-Type]


          - statusCode: 200
            selectionPattern: '2\d{2}'
            responseParameters:
              { integration.response.header.Content-Type: true }
            responseTemplates:
              application/xml: |-
                #set($inputRoot = $input.path('$'))
chuckthepiranha commented 3 years ago

So I was able to specify the content type by overriding the headers with a mapping template:


            selectionPattern: '2\d{2}'
            responseTemplates:
              application/xml: |-
                #set($inputRoot = $input.path('$'))
                #set($context.responseOverride.header.Content-Type = 'application/xml')