1
APIレベルでボディマッピングテンプレートを更新するための適切なjavascript APIとは何ですか? updateIntegrationResponseはこのレベルでは実行できませんaws apigatewayボディマッピングのテンプレートをAPIレベルのjavascript SDKで更新する
APIレベルでボディマッピングテンプレートを更新するための適切なjavascript APIとは何ですか? updateIntegrationResponseはこのレベルでは実行できませんaws apigatewayボディマッピングのテンプレートをAPIレベルのjavascript SDKで更新する
以下のAPIを使用して最終的に終了します。トリッキーな部分は、スラッシュを〜1に置き換えて動作させる必要があることです。
const params = {
responseType: response.type.toString(), /* required */
restApiId: apiId, /* required */
patchOperations:[{
op: 'add',
path: '/responseTemplates/'+ response.bodyMappingTemplate.contentType.replace("/", "~1"),
value: response.bodyMappingTemplate.content
}
]
};
this.apiGatewaySDK.updateGatewayResponse(params, (err, data) => {
if (err) {
reject(err);
}
else {
this.serverless.cli.log('API Gateway Configuring: Body mapping templates are set correctly');
resolve('Body Mapping Templates set successfully:', response.type);
}
});