function parseSwagger () {
  try {
    // Clear any previous results
    editors.clearResults();

    // Get all the parameters
    parser = parser || new SwaggerParser();
    var options = form.getOptions();
    var method = form.method.button.val();
    var api = form.getAPI();

    // Call Swagger Parser
    parser[method](api, options)
      .then(function () {
        // Show the results
        var results = parser.$refs.values();
        Object.keys(results).forEach(function (key) {
          editors.showResult(key, results[key]);
        });
      })
      .catch(function (err) {
        editors.showError(ono(err));
        analytics.trackError(err);
      });

    // Track the operation
    counters[method]++;
    analytics.trackEvent('button', 'click', method, counters[method]);
  }
  catch (err) {
    editors.showError(ono(err));
    analytics.trackError(err);
  }
}
/**
 * This function is called when the "Validate it!" button is clicked.
 * It calls Swagger Parser, passing it all the options selected on the form.
 */
This function is called when the "Validate it!" button is clicked.
It calls Swagger Parser, passing it all the options selected on the form.
This function is called when the " Validate it! " button is clicked . It calls Swagger Parser passing it all the options selected on the form .
function parseSwagger () {
  try {
    editors.clearResults();
    parser = parser || new SwaggerParser();
    var options = form.getOptions();
    var method = form.method.button.val();
    var api = form.getAPI();
    parser[method](api, options)
      .then(function () {
        var results = parser.$refs.values();
        Object.keys(results).forEach(function (key) {
          editors.showResult(key, results[key]);
        });
      })
      .catch(function (err) {
        editors.showError(ono(err));
        analytics.trackError(err);
      });
    counters[method]++;
    analytics.trackEvent('button', 'click', method, counters[method]);
  }
  catch (err) {
    editors.showError(ono(err));
    analytics.trackError(err);
  }
}
function parseSwagger ( ) { try { editors . clearResults ( ) ; parser = parser || new SwaggerParser ( ) ; var options = form . getOptions ( ) ; var method = form . method . button . val ( ) ; var api = form . getAPI ( ) ; parser [ method ] ( api , options ) . then ( function ( ) { var results = parser . $refs . values ( ) ; Object . keys ( results ) . forEach ( function ( key ) { editors . showResult ( key , results [ key ] ) ; } ) ; } ) . catch ( function ( err ) { editors . showError ( ono ( err ) ) ; analytics . trackError ( err ) ; } ) ; counters [ method ] ++ ; analytics . trackEvent ( 'button' , 'click' , method , counters [ method ] ) ; } catch ( err ) { editors . showError ( ono ( err ) ) ; analytics . trackError ( err ) ; } }
This function is called when the "Validate it!"
This function is called when the " Validate it! "
// Clear any previous results // Get all the parameters // Call Swagger Parser // Show the results // Track the operation