packages/api-gateway/src/cli/inspect-api.js
function executeCommand(parameters) {
    if (parameters.colors === undefined) {
      parameters.colors = plugin.myrmex.getConfig('colors');
    }
    return plugin.findApi(parameters.apiIdentifier)
    .then(api => {
      return api.generateSpec(parameters.specVersion);
    })
    .then(jsonSpec => {
      let spec = JSON.stringify(jsonSpec, null, 2);
      if (parameters.colors) {
        spec = icli.highlight(spec, { json: true });
      }
      icli.print(spec);
      return Promise.resolve(jsonSpec);
    });
  }
function executeCommand(parameters) {
    if (parameters.colors === undefined) {
      parameters.colors = plugin.myrmex.getConfig('colors');
    }
    return plugin.findApi(parameters.apiIdentifier)
    .then(api => {
      return api.generateSpec(parameters.specVersion);
    })
    .then(jsonSpec => {
      let spec = JSON.stringify(jsonSpec, null, 2);
      if (parameters.colors) {
        spec = icli.highlight(spec, { json: true });
      }
      icli.print(spec);
      return Promise.resolve(jsonSpec);
    });
  }
function executeCommand ( parameters ) { if ( parameters . colors === undefined ) { parameters . colors = plugin . myrmex . getConfig ( 'colors' ) ; } return plugin . findApi ( parameters . apiIdentifier ) . then ( api => { return api . generateSpec ( parameters . specVersion ) ; } ) . then ( jsonSpec => { let spec = JSON . stringify ( jsonSpec , null , 2 ) ; if ( parameters . colors ) { spec = icli . highlight ( spec , { json : true } ) ; } icli . print ( spec ) ; return Promise . resolve ( jsonSpec ) ; } ) ; }
Output API specification
@param {Object} parameters - the parameters provided in the command and in the prompt
@returns {Promise<null>} - The execution stops here
Output API specification