From 8fe21671faf89184bfa8c6c5643fac62211a8ec3 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Thu, 18 Apr 2024 10:29:27 +0530 Subject: [PATCH 1/2] chore: fixed path level server and description requirement in spec file --- src/services/twilio-api/api-browser.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/services/twilio-api/api-browser.js b/src/services/twilio-api/api-browser.js index 8d21f263..d5f1757d 100644 --- a/src/services/twilio-api/api-browser.js +++ b/src/services/twilio-api/api-browser.js @@ -75,10 +75,15 @@ class TwilioApiBrowser { const path = entry[1]; if (key === '/healthcheck') return; // Naive assumption: The Twilio APIs only have a single server. - path.server = path.servers[0].url; + if(path.servers !== undefined) + path.server = path.servers[0].url; + else + path.server = spec.servers[0].url; delete path.servers; path.operations = {}; + if(path.description === undefined) + path.description = ""; path.description = path.description.replace(/(\r\n|\n|\r)/gm, ' '); // Move the operations into an operations object. From 3b69f9041e1d1e4bbb9c317db0958d1864a3ea00 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Thu, 18 Apr 2024 10:41:57 +0530 Subject: [PATCH 2/2] chore: fixed eslint error --- package-lock.json | 4 ++-- src/services/twilio-api/api-browser.js | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3c644bdc..9b34df17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@twilio/cli-core", - "version": "7.23.2", + "version": "7.23.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@twilio/cli-core", - "version": "7.23.2", + "version": "7.23.3", "license": "MIT", "dependencies": { "@actions/core": "^1.0.0", diff --git a/src/services/twilio-api/api-browser.js b/src/services/twilio-api/api-browser.js index d5f1757d..f533e6f5 100644 --- a/src/services/twilio-api/api-browser.js +++ b/src/services/twilio-api/api-browser.js @@ -75,15 +75,12 @@ class TwilioApiBrowser { const path = entry[1]; if (key === '/healthcheck') return; // Naive assumption: The Twilio APIs only have a single server. - if(path.servers !== undefined) - path.server = path.servers[0].url; - else - path.server = spec.servers[0].url; + if (path.servers === undefined) path.server = spec.servers[0].url; + else path.server = path.servers[0].url; delete path.servers; path.operations = {}; - if(path.description === undefined) - path.description = ""; + if (path.description === undefined) path.description = ''; path.description = path.description.replace(/(\r\n|\n|\r)/gm, ' '); // Move the operations into an operations object.