Skip to content

Commit c8feb9e

Browse files
committed
deal with missing paths
1 parent f83cfee commit c8feb9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/definitionGenerator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ class DefinitionGenerator {
151151
path.servers = servers
152152
}
153153

154-
let slashPath = event?.http?.path || event.httpApi?.path
154+
let slashPath = (event?.http?.path || event.httpApi?.path) ?? '/'
155155
const pathStart = new RegExp(/^\//, 'g')
156156
if (pathStart.test(slashPath) === false) {
157-
slashPath = `/${event?.http?.path||event.httpApi?.path}`
157+
slashPath = `/${(event?.http?.path||event.httpApi?.path)?? ''}`
158158
}
159159

160160
if (paths[slashPath]) {

0 commit comments

Comments
 (0)