Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove superfluous resolve #47

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
{
"name": "Richard Klose",
"email": "[email protected]"
},
{
"name": "Tyler Waters",
"email": "[email protected]"
}
],
"homepage": "https://github.com/fmvilas/openapi3-generator",
Expand Down