Skip to content

Commit

Permalink
Create one file per path
Browse files Browse the repository at this point in the history
  • Loading branch information
David Kirchner committed May 6, 2020
1 parent 7de726f commit 656265c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/beautifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 656265c

Please sign in to comment.