Skip to content

Commit

Permalink
🔧 fix: Ampersand in URL search params is discarded
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltyAom committed Feb 19, 2025
1 parent 6831145 commit 4f51a40
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ export const swagger = async <Path extends string = '/swagger'>(
const ALLOWED_METHODS = ['GET', 'PUT', 'POST', 'DELETE', 'OPTIONS', 'HEAD', 'PATCH', 'TRACE']
totalRoutes = routes.length

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

return {
Expand Down

0 comments on commit 4f51a40

Please sign in to comment.