ng-swagger-gen.js
function ngSwaggerGen(options) {
  if (typeof options.swagger != 'string') {
    console.error("Swagger file not specified in the 'swagger' option");
    process.exit(1);
  }

  var globalTunnel = require('global-tunnel-ng');
  globalTunnel.initialize();
  
  $RefParser.bundle(options.swagger, { dereference: { circular: false } }).then(
    data => {
      doGenerate(data, options);
    },
    err => {
      console.error(
        `Error reading swagger location ${options.swagger}: ${err}`
      );
    }
  ).catch(function (error) {
    console.error(`Error: ${error}`);
  });
}
function ngSwaggerGen(options) {
  if (typeof options.swagger != 'string') {
    console.error("Swagger file not specified in the 'swagger' option");
    process.exit(1);
  }

  var globalTunnel = require('global-tunnel-ng');
  globalTunnel.initialize();
  
  $RefParser.bundle(options.swagger, { dereference: { circular: false } }).then(
    data => {
      doGenerate(data, options);
    },
    err => {
      console.error(
        `Error reading swagger location ${options.swagger}: ${err}`
      );
    }
  ).catch(function (error) {
    console.error(`Error: ${error}`);
  });
}
function ngSwaggerGen ( options ) { if ( typeof options . swagger != 'string' ) { console . error ( "Swagger file not specified in the 'swagger' option" ) ; process . exit ( 1 ) ; } var globalTunnel = require ( 'global-tunnel-ng' ) ; globalTunnel . initialize ( ) ; $RefParser . bundle ( options . swagger , { dereference : { circular : false } } ) . then ( data => { doGenerate ( data , options ) ; } , err => { console . error ( ` ${ options . swagger } ${ err } ` ) ; } ) . catch ( function ( error ) { console . error ( ` ${ error } ` ) ; } ) ; }
Main generate function
Main generate function