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();