From 656265c483a725eb80e423b49af483e421536c6d Mon Sep 17 00:00:00 2001 From: David Kirchner Date: Wed, 6 May 2020 11:59:24 -0700 Subject: [PATCH] Create one file per path Fixes #40 --- lib/beautifier.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/beautifier.js b/lib/beautifier.js index b5c2693..2089e99 100644 --- a/lib/beautifier.js +++ b/lib/beautifier.js @@ -165,7 +165,9 @@ module.exports = (openapi, config) => { } _.each(openapi.paths, (path, pathName) => { - path.endpointName = pathName === '/' ? 'root' : cleanBrackets(pathName.split('/')[1]); + path.endpointName = pathName === '/' ? + 'root' : + pathName.replace(/^\//, '').split('/').map(cleanBrackets).join('/'); const basePath = openapi.basePath.trim();