如何在APIGateway/Swagger中将响应头内容类型设置为application/xml
如何配置Swagger/APIGateway,以将使用和生成xml的APIGateway Lambda GET端点的响应头属性内容类型设置为“application/xml” 当前响应头内容类型值为“application/json” 我试图这样指定它:-如何在APIGateway/Swagger中将响应头内容类型设置为application/xml,swagger,aws-api-gateway,Swagger,Aws Api Gateway,如何配置Swagger/APIGateway,以将使用和生成xml的APIGateway Lambda GET端点的响应头属性内容类型设置为“application/xml” 当前响应头内容类型值为“application/json” 我试图这样指定它:- "/v1/XXXXXXX": { "get": { "produces": [ "application/xml" ], "responses": { "200": { "d
"/v1/XXXXXXX": {
"get": {
"produces": [
"application/xml"
],
"responses": {
"200": {
"description": "Meter reading data",
"schema": { ........ }
}
},
"x-amazon-apigateway-integration": {
"responses": {
"default": {
"statusCode": "200",
"responseParameters": {
"method.response.header.Content-Type": "'application/xml'"
}
}
}
}
这是如下所示的错误:-
Errors found during import: Unable to put integration response on 'GET' for resource at path '/v1/XXXXXXXXX': Invalid mapping expression specified: Validation Result: warnings : [], errors : [Invalid mapping expression parameter specified: method.response.header.Content-Type]
非常感谢
Sam内容类型应作为映射模板添加。 您将其设置在“responseParameters”下,这是不正确的 在以下任一项下设置“application/xml”:
内容类型应作为映射模板添加。 您将其设置在“responseParameters”下,这是不正确的 在以下任一项下设置“application/xml”: