@@ -62,7 +62,8 @@ export const swagger = async <Path extends string = '/swagger'>(
62
62
}
63
63
64
64
const app = new Elysia ( { name : '@elysiajs/swagger' } )
65
- const prefixedPath = join ( app . config . prefix ?? "/" , path )
65
+ const appPrefix = app . config . prefix ?? "/"
66
+ const prefixedPath = join ( appPrefix , path )
66
67
67
68
app . get ( path , function documentation ( request ) {
68
69
// External Prefix, if the app is behind a reverse proxy
@@ -134,7 +135,7 @@ export const swagger = async <Path extends string = '/swagger'>(
134
135
schema,
135
136
hook : route . hooks ,
136
137
method,
137
- path : join ( extPrefix , prefixedPath , route . path ) ,
138
+ path : join ( extPrefix , appPrefix , route . path ) ,
138
139
// @ts -ignore
139
140
models : app . definitions ?. type ,
140
141
contentType : route . hooks . type
@@ -147,7 +148,7 @@ export const swagger = async <Path extends string = '/swagger'>(
147
148
schema,
148
149
hook : route . hooks ,
149
150
method : route . method ,
150
- path : join ( extPrefix , prefixedPath , route . path ) ,
151
+ path : join ( extPrefix , appPrefix , route . path ) ,
151
152
// @ts -ignore
152
153
models : app . definitions ?. type ,
153
154
contentType : route . hooks . type
0 commit comments