mirror of
https://github.com/zoriya/elysia-swagger.git
synced 2025-12-06 00:36:10 +00:00
🔧 fix: Ampersand in URL search params is discarded
This commit is contained in:
@@ -117,7 +117,8 @@ export const swagger = async <Path extends string = '/swagger'>(
|
|||||||
const ALLOWED_METHODS = ['GET', 'PUT', 'POST', 'DELETE', 'OPTIONS', 'HEAD', 'PATCH', 'TRACE']
|
const ALLOWED_METHODS = ['GET', 'PUT', 'POST', 'DELETE', 'OPTIONS', 'HEAD', 'PATCH', 'TRACE']
|
||||||
totalRoutes = routes.length
|
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
|
if (route.hooks?.detail?.hide === true) return
|
||||||
// TODO: route.hooks?.detail?.hide !== false add ability to hide: false to prevent excluding
|
// TODO: route.hooks?.detail?.hide !== false add ability to hide: false to prevent excluding
|
||||||
if (excludeMethods.includes(route.method)) return
|
if (excludeMethods.includes(route.method)) return
|
||||||
@@ -147,7 +148,7 @@ export const swagger = async <Path extends string = '/swagger'>(
|
|||||||
models: app.definitions?.type,
|
models: app.definitions?.type,
|
||||||
contentType: route.hooks.type
|
contentType: route.hooks.type
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user