import https from 'https'; /** * Download the spec file from a HTTPS resource * @param url */ export async function readSpecFromHttps(url: string): Promise { return new Promise((resolve, reject) => { https.get(url, response => { let body = ''; response.on('data', chunk => { body += chunk; }); response.on('end', () => { resolve(body); }); response.on('error', () => { reject(`Could not read OpenApi spec: "${url}"`); }); }); }); }