bin/swagger-jsdoc.js
function loadSpecification(defPath, data) {
  const resolvedPath = path.resolve(defPath);

  const extName = path.extname(resolvedPath);
  const loader = LOADERS[extName];

  // Check whether the definition file is actually a usable file
  if (loader === undefined) {
    throw new Error('Definition file should be .js, .json, .yml or .yaml');
  }

  const swaggerDefinition = loader(data, resolvedPath);
  return swaggerDefinition;
}
function loadSpecification(defPath, data) {
  const resolvedPath = path.resolve(defPath);

  const extName = path.extname(resolvedPath);
  const loader = LOADERS[extName];

  // Check whether the definition file is actually a usable file
  if (loader === undefined) {
    throw new Error('Definition file should be .js, .json, .yml or .yaml');
  }

  const swaggerDefinition = loader(data, resolvedPath);
  return swaggerDefinition;
}
function loadSpecification ( defPath , data ) { const resolvedPath = path . resolve ( defPath ) ; const extName = path . extname ( resolvedPath ) ; const loader = LOADERS [ extName ] ; // Check whether the definition file is actually a usable file if ( loader === undefined ) { throw new Error ( 'Definition file should be .js, .json, .yml or .yaml' ) ; } const swaggerDefinition = loader ( data , resolvedPath ) ; return swaggerDefinition ; }
Get an object of the definition file configuration.
Get an object of the definition file configuration .