From 577406d8317d0d7a6ad60286aea68af8ac201cb0 Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 25 Aug 2020 20:22:01 +0300 Subject: [PATCH 1/3] - Removed deprecation warning, both from code & from deprecation help page - Changed default payload version to 2.0 --- docs/deprecations.md | 8 -------- lib/plugins/aws/package/compile/events/httpApi/index.js | 9 +-------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/docs/deprecations.md b/docs/deprecations.md index 6e5c0ef9848..a998f9a7da6 100644 --- a/docs/deprecations.md +++ b/docs/deprecations.md @@ -12,14 +12,6 @@ layout: Doc `maximumEventAge` and `maximumRetryAttempts` should be defined directly at function level. Support for those settings on `destinations` level, will be removed with v2.0.0 -
 
- -## AWS HTTP API payload format - -Default HTTP API Payload version will be switched to 2.0 with next major release (For more details see [payload format documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.proxy-format)) - -Configure `httpApi.payload` explicitly to ensure seamless migration. -
 
## Outdated Node.js version diff --git a/lib/plugins/aws/package/compile/events/httpApi/index.js b/lib/plugins/aws/package/compile/events/httpApi/index.js index 43b6fad6580..57bfa7806fe 100644 --- a/lib/plugins/aws/package/compile/events/httpApi/index.js +++ b/lib/plugins/aws/package/compile/events/httpApi/index.js @@ -478,18 +478,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); From 69b0d130c663d92e03b716b1220f9ea3335e5b5b Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 25 Aug 2020 20:28:15 +0300 Subject: [PATCH 2/3] - Switched api gateway payload version to 2.0 in corresponding test --- lib/plugins/aws/package/compile/events/httpApi/index.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ac152b23307..cc9a7e3c4ac 100644 --- a/lib/plugins/aws/package/compile/events/httpApi/index.test.js +++ b/lib/plugins/aws/package/compile/events/httpApi/index.test.js @@ -77,7 +77,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')]; From 46dca4a159bd17db181c208017d1984e0ce9355d Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 25 Aug 2020 22:04:29 +0300 Subject: [PATCH 3/3] Added back AWS Http Api version in deprecations.md --- docs/deprecations.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/deprecations.md b/docs/deprecations.md index a998f9a7da6..6e5c0ef9848 100644 --- a/docs/deprecations.md +++ b/docs/deprecations.md @@ -12,6 +12,14 @@ layout: Doc `maximumEventAge` and `maximumRetryAttempts` should be defined directly at function level. Support for those settings on `destinations` level, will be removed with v2.0.0 +
 
+ +## AWS HTTP API payload format + +Default HTTP API Payload version will be switched to 2.0 with next major release (For more details see [payload format documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.proxy-format)) + +Configure `httpApi.payload` explicitly to ensure seamless migration. +
 
## Outdated Node.js version