@@ -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
@@ -137,7 +138,7 @@ export const swagger = async <Path extends string = '/swagger'>(
137
138
schema,
138
139
hook : route . hooks ,
139
140
method,
140
- path : join ( extPrefix , prefixedPath , route . path ) ,
141
+ path : join ( extPrefix , appPrefix , route . path ) ,
141
142
// @ts -ignore
142
143
models : app . definitions ?. type ,
143
144
contentType : route . hooks . type
@@ -150,7 +151,7 @@ export const swagger = async <Path extends string = '/swagger'>(
150
151
schema,
151
152
hook : route . hooks ,
152
153
method : route . method ,
153
- path : join ( extPrefix , prefixedPath , route . path ) ,
154
+ path : join ( extPrefix , appPrefix , route . path ) ,
154
155
// @ts -ignore
155
156
models : app . definitions ?. type ,
156
157
contentType : route . hooks . type
0 commit comments