We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4f51a40 + a4229eb commit d5c1dfdCopy full SHA for d5c1dfd
src/index.ts
@@ -66,7 +66,7 @@ export const swagger = async <Path extends string = '/swagger'>(
66
67
const app = new Elysia({ name: '@elysiajs/swagger' })
68
69
- app.get(path, function documentation() {
+ app.get(path, function documentation({request}) {
70
const combinedSwaggerOptions = {
71
url: openAPISpecUrl,
72
dom_id: '#swagger-ui',
@@ -85,7 +85,7 @@ export const swagger = async <Path extends string = '/swagger'>(
85
const scalarConfiguration: ReferenceConfiguration = {
86
spec: {
87
...scalarConfig.spec,
88
- url: openAPISpecUrl
+ url: `${new URL(request.url).pathname.replace(/\/$/, "")}/json`
89
},
90
...scalarConfig,
91
// so we can showcase the elysia theme
0 commit comments