serverless-apigateway-service-proxy icon indicating copy to clipboard operation
serverless-apigateway-service-proxy copied to clipboard

SQS not able to specify headers in responseParameters

Open chuckthepiranha opened this issue 4 years ago • 1 comments

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 avatar Dec 10 '20 19:12 chuckthepiranha

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')

chuckthepiranha avatar Dec 15 '20 22:12 chuckthepiranha