diff --git a/package-lock.json b/package-lock.json index c7d906f..bbff19e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "serverless-openapi-documenter", - "version": "0.0.16", + "version": "0.0.17", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "serverless-openapi-documenter", - "version": "0.0.16", + "version": "0.0.17", "license": "MIT", "dependencies": { "@apidevtools/json-schema-ref-parser": "^9.0.9", diff --git a/package.json b/package.json index 4617ba6..d9aa9d9 100644 --- a/package.json +++ b/package.json @@ -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": [ diff --git a/src/definitionGenerator.js b/src/definitionGenerator.js index 7b3154a..dcbed40 100644 --- a/src/definitionGenerator.js +++ b/src/definitionGenerator.js @@ -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}); + } } } }