From 1596738cf919bfb5ed702c40f9d3f2b39d529a81 Mon Sep 17 00:00:00 2001 From: andreizet Date: Thu, 27 Aug 2020 19:09:30 +0300 Subject: [PATCH] feat(AWS HTTP API): Switch default payload mode to 2.0 (#8133) BREAKING CHANGE: In AWS HTTP API events (`httpApi`) default `payload` was changed from `1.0` to `2.0` --- lib/plugins/aws/package/compile/events/httpApi/index.js | 9 +-------- .../aws/package/compile/events/httpApi/index.test.js | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/plugins/aws/package/compile/events/httpApi/index.js b/lib/plugins/aws/package/compile/events/httpApi/index.js index ef7c817d524..9d664ecf5f2 100644 --- a/lib/plugins/aws/package/compile/events/httpApi/index.js +++ b/lib/plugins/aws/package/compile/events/httpApi/index.js @@ -482,18 +482,11 @@ Object.defineProperties( const providerConfig = this.serverless.service.provider; const userConfig = providerConfig.httpApi || {}; - if (!userConfig.payload) { - this.serverless._logDeprecation( - 'AWS_HTTP_API_VERSION', - 'Default HTTP API Payload version will be switched to 2.0 with next major release. Configure "httpApi.payload" explicitly to hide this message.' - ); - } - const properties = { ApiId: this.getApiIdConfig(), IntegrationType: 'AWS_PROXY', IntegrationUri: resolveTargetConfig(routeTargetData), - PayloadFormatVersion: userConfig.payload || '1.0', + PayloadFormatVersion: userConfig.payload || '2.0', }; if (routeTargetData.timeout) { properties.TimeoutInMillis = Math.round(routeTargetData.timeout * 1000); diff --git a/lib/plugins/aws/package/compile/events/httpApi/index.test.js b/lib/plugins/aws/package/compile/events/httpApi/index.test.js index f81a7bc9de2..55f78e5bb0c 100644 --- a/lib/plugins/aws/package/compile/events/httpApi/index.test.js +++ b/lib/plugins/aws/package/compile/events/httpApi/index.test.js @@ -74,7 +74,7 @@ describe('HttpApiEvents', () => { const resource = cfResources[naming.getHttpApiIntegrationLogicalId('foo')]; expect(resource.Type).to.equal('AWS::ApiGatewayV2::Integration'); expect(resource.Properties.IntegrationType).to.equal('AWS_PROXY'); - expect(resource.Properties.PayloadFormatVersion).to.equal('1.0'); + expect(resource.Properties.PayloadFormatVersion).to.equal('2.0'); }); it('Should ensure higher timeout than function', () => { const resource = cfResources[naming.getHttpApiIntegrationLogicalId('foo')];