From c0a2ecf453fa82d46bf2fda34708864bc440203d Mon Sep 17 00:00:00 2001 From: "A. Singh" <32884734+A-5ingh@users.noreply.github.com> Date: Wed, 4 Nov 2020 22:05:01 +0530 Subject: [PATCH] feat: Deprecate `service` object notation (#8466) --- docs/deprecations.md | 6 ++++++ lib/classes/Service.js | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/docs/deprecations.md b/docs/deprecations.md index 5093d3b61..b551e3c38 100644 --- a/docs/deprecations.md +++ b/docs/deprecations.md @@ -6,6 +6,12 @@ layout: Doc # Serverless Framework Deprecations +
 
+ +## `service` property object notation + +Starting with v3.0.0, object notation for `service` property will no longer be recognized. Set `service` property directly with service name. +
 
## `cloudFront` event `behavior.ForwardedValues` property diff --git a/lib/classes/Service.js b/lib/classes/Service.js index f4913a339..26cecf349 100644 --- a/lib/classes/Service.js +++ b/lib/classes/Service.js @@ -131,6 +131,11 @@ class Service { } if (_.isObject(serverlessFile.service)) { + this.serverless._logDeprecation( + 'SERVICE_OBJECT_NOTATION', + 'Starting from next major object notation for "service" property will no longer be ' + + 'recognized. Set "service" property directly with service name.' + ); this.serviceObject = serverlessFile.service; this.service = serverlessFile.service.name; } else {