From fe3db9452e802645ba098201f671bb95801c3def Mon Sep 17 00:00:00 2001 From: Shubham Date: Tue, 30 Apr 2024 11:08:15 +0530 Subject: [PATCH] chore: fixed path level server and description requirement in spec file (#247) * chore: fixed path level server and description requirement in spec file * chore: fixed eslint error --- src/services/twilio-api/api-browser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/twilio-api/api-browser.js b/src/services/twilio-api/api-browser.js index 8d21f263..f533e6f5 100644 --- a/src/services/twilio-api/api-browser.js +++ b/src/services/twilio-api/api-browser.js @@ -75,10 +75,12 @@ 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 = spec.servers[0].url; + else path.server = path.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.