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
4 changes: 2 additions & 2 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'>(

const app = new Elysia({ name: '@elysiajs/swagger' })

app.get(path, function documentation() {
app.get(path, function documentation({request}) {
const combinedSwaggerOptions = {
url: openAPISpecUrl,
dom_id: '#swagger-ui',
Expand All @@ -85,7 +85,7 @@ export const swagger = async <Path extends string = '/swagger'>(
const scalarConfiguration: ReferenceConfiguration = {
spec: {
...scalarConfig.spec,
url: openAPISpecUrl
url: `${new URL(request.url).pathname.replace(/\/$/, "")}/json`
},
...scalarConfig,
// so we can showcase the elysia theme
Expand Down