lib/generate/index.js
function handleUrlSwagger(profile, profileKey) {
    console.log(chalk`{green [${profileKey}]} Input swagger URL : {cyan ${profile.url}}`);
    const options = {
        rejectUnauthorized: false
    };
    needle.get(profile.url, options, (err, resp, body) => {
        if (err) {
            console.log(chalk`{red Cannot read swagger URL '{bold ${profile.url}}'.}`);
            console.log(chalk.red(err));
        } else {
            handleSwagger(body, profile, profileKey);
        }
    });
}
function handleUrlSwagger(profile, profileKey) {
    console.log(chalk`{green [${profileKey}]} Input swagger URL : {cyan ${profile.url}}`);
    const options = {
        rejectUnauthorized: false
    };
    needle.get(profile.url, options, (err, resp, body) => {
        if (err) {
            console.log(chalk`{red Cannot read swagger URL '{bold ${profile.url}}'.}`);
            console.log(chalk.red(err));
        } else {
            handleSwagger(body, profile, profileKey);
        }
    });
}
function handleUrlSwagger ( profile , profileKey ) { console . log ( chalk ` ${ profileKey } ${ profile . url } ` ) ; const options = { rejectUnauthorized : false } ; needle . get ( profile . url , options , ( err , resp , body ) => { if ( err ) { console . log ( chalk ` ${ profile . url } ` ) ; console . log ( chalk . red ( err ) ) ; } else { handleSwagger ( body , profile , profileKey ) ; } } ) ; }
Reads the swagger json from a URL specified in the profile.
@param {Profile} profile The profile being handled.
@param {String} profileKey The name of the profile.
Reads the swagger json from a URL specified in the profile .