diff --git a/lib/generator.js b/lib/generator.js index e98e442..0ad7ee2 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -126,7 +126,7 @@ const generateOperationFile = (config, operation, operation_name) => new Promise * @param {Object} config Configuration options * @returns {Promise} */ -const generateOperationFiles = config => new Promise((resolve, reject) => { +const generateOperationFiles = config => { const files = {}; _.each(config.data.openapi.paths, (path, path_name) => { const operation_name = path.endpointName; @@ -142,12 +142,12 @@ const generateOperationFiles = config => new Promise((resolve, reject) => { subresource: (path_name.substring(operation_name.length+1) || '/').replace(/}/g, '').replace(/{/g, ':') }); - Promise.all( - _.map(files, (operation, operation_name) => generateOperationFile(config, operation, operation_name)) - ).then(resolve).catch(reject); - resolve(); }); -}); + + return Promise.all( + _.map(files, (operation, operation_name) => generateOperationFile(config, operation, operation_name)) + ); +}; /** * Generates the directory structure. diff --git a/package.json b/package.json index b87b113..d2c9d70 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,10 @@ { "name": "Richard Klose", "email": "richard.klose@gmail.com" + }, + { + "name": "Tyler Waters", + "email": "tyler.waters@gmail.com" } ], "homepage": "https://github.com/fmvilas/openapi3-generator",