Skip to content

Commit 656265c

Browse files
author
David Kirchner
committed
Create one file per path
Fixes openapi-contrib#40
1 parent 7de726f commit 656265c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/beautifier.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ module.exports = (openapi, config) => {
165165
}
166166

167167
_.each(openapi.paths, (path, pathName) => {
168-
path.endpointName = pathName === '/' ? 'root' : cleanBrackets(pathName.split('/')[1]);
168+
path.endpointName = pathName === '/' ?
169+
'root' :
170+
pathName.replace(/^\//, '').split('/').map(cleanBrackets).join('/');
169171

170172
const basePath = openapi.basePath.trim();
171173

0 commit comments

Comments
 (0)