Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const swagger = async <Path extends string = '/swagger'>(

app.get(path, function documentation() {
const combinedSwaggerOptions = {
url: `${relativePath}/json`,
url: `/${relativePath}/json`,
dom_id: '#swagger-ui',
...swaggerOptions
}
Expand All @@ -83,7 +83,7 @@ export const swagger = async <Path extends string = '/swagger'>(
const scalarConfiguration: ReferenceConfiguration = {
spec: {
...scalarConfig.spec,
url: `${relativePath}/json`
url: `/${relativePath}/json`
},
...scalarConfig
}
Expand Down Expand Up @@ -111,7 +111,7 @@ export const swagger = async <Path extends string = '/swagger'>(
if (routes.length !== totalRoutes) {
const ALLOWED_METHODS = ['GET', 'PUT', 'POST', 'DELETE', 'OPTIONS', 'HEAD', 'PATCH', 'TRACE']
totalRoutes = routes.length

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
Expand Down