Skip to content

Commit

Permalink
Merge pull request #30 from JaredCE/bugfix/multiple-operations
Browse files Browse the repository at this point in the history
Bugfix/multiple operations
  • Loading branch information
JaredCE authored Jul 22, 2022
2 parents 89237c1 + 60d4a93 commit f382a6e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless-openapi-documenter",
"version": "0.0.16",
"version": "0.0.17",
"description": "Generate OpenAPI v3 documentation and Postman Collections from your Serverless Config",
"main": "index.js",
"keywords": [
Expand Down
6 changes: 5 additions & 1 deletion src/definitionGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ class DefinitionGenerator {
slashPath = `/${event?.http?.path||event.httpApi?.path}`
}

Object.assign(paths, {[slashPath]: path})
if (paths[slashPath]) {
Object.assign(paths[slashPath], path);
} else {
Object.assign(paths, {[slashPath]: path});
}
}
}
}
Expand Down

0 comments on commit f382a6e

Please sign in to comment.