diff --git a/lib/index.js b/lib/index.js index 1b58463a..3eba8de2 100644 --- a/lib/index.js +++ b/lib/index.js @@ -15,8 +15,12 @@ const finalizeSpecificationObject = require('./helpers/finalizeSpecificationObje * @requires swagger-parser */ module.exports = (options) => { - if ((!options.swaggerDefinition || !options.definition) && !options.apis) { - throw new Error('Provided options are incorrect.'); + if (!options.swaggerDefinition && !options.definition) { + throw new Error( + 'Provided swaggerDefinition or definition attributes are incorrect.' + ); + } else if (!options.apis) { + throw new Error('Provided apis attribute are incorrect.'); } try {