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.