我想覆盖从此集成发送的响应正文。我指的是这个链接https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html
它说要使用overwrite:$response.body. 但这不起作用。我给出错误说“无效的目标参数”
APIVersionIntegration:
Type: AWS::ApiGatewayV2::Integration
Properties:
ApiId: !Ref HttpApi
ConnectionType: INTERNET
CredentialsArn: !GetAtt MyHttpApiRole.Arn
IntegrationType: AWS_PROXY
RequestParameters:
MessageBody: "$request.body"
QueueUrl: !Ref DataPublisherSQS
ResponseParameters:
"200":
ResponseParameters:
- Source: "application/json"
Destination: "overwrite:header.content-type"
- Source: ""
Destination: "overwrite:$response.body"
IntegrationSubtype: "SQS-SendMessage"
# IntegrationMethod: POST
PayloadFormatVersion: "1.0"
Run Code Online (Sandbox Code Playgroud)