Skip to content
Closed
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
8 changes: 3 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@ export const swagger =
...documentation.info
}

const relativePath = path.startsWith('/') ? path.slice(1) : path

app.get(
path,
() => {
const combinedSwaggerOptions = {
url: `${relativePath}/json`,
url: `${path}/json`,
dom_id: '#swagger-ui',
...swaggerOptions
}
Expand All @@ -85,7 +83,7 @@ export const swagger =
const scalarConfiguration: ReferenceConfiguration = {
spec: {
...scalarConfig.spec,
url: `${relativePath}/json`,
url: `${path}/json`,
},
...scalarConfig
}
Expand Down Expand Up @@ -146,7 +144,7 @@ export const swagger =
...documentation.info
}
},
paths: {...filterPaths(schema, relativePath, {
paths: {...filterPaths(schema, path, {
excludeStaticFile,
exclude: Array.isArray(exclude) ? exclude : [exclude]
}),
Expand Down