Skip to content

Commit 4f51a40

Browse files
committed
🔧 fix: Ampersand in URL search params is discarded
1 parent 6831145 commit 4f51a40

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ export const swagger = async <Path extends string = '/swagger'>(
117117
const ALLOWED_METHODS = ['GET', 'PUT', 'POST', 'DELETE', 'OPTIONS', 'HEAD', 'PATCH', 'TRACE']
118118
totalRoutes = routes.length
119119

120-
for(const route of routes) {
120+
// forEach create a clone of a route (can't use for-of)
121+
routes.forEach((route: InternalRoute) => {
121122
if (route.hooks?.detail?.hide === true) return
122123
// TODO: route.hooks?.detail?.hide !== false add ability to hide: false to prevent excluding
123124
if (excludeMethods.includes(route.method)) return
@@ -147,7 +148,7 @@ export const swagger = async <Path extends string = '/swagger'>(
147148
models: app.definitions?.type,
148149
contentType: route.hooks.type
149150
})
150-
}
151+
})
151152
}
152153

153154
return {

0 commit comments

Comments
 (0)