File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable @typescript-eslint/ban-ts-comment */
22import { Elysia , type InternalRoute } from 'elysia'
3+ import { resolve } from 'node:path' ;
34
45import { SwaggerUIRender } from './swagger'
56import { ScalarRender } from './scalar'
@@ -64,9 +65,9 @@ export const swagger = async <Path extends string = '/swagger'>(
6465
6566 const app = new Elysia ( { name : '@elysiajs/swagger' } )
6667
67- app . get ( path , function documentation ( ) {
68+ app . get ( path , function documentation ( { path : reqPath } ) {
6869 const combinedSwaggerOptions = {
69- url : `/ ${ relativePath } / json` ,
70+ url : resolve ( reqPath , '/ json' ) ,
7071 dom_id : '#swagger-ui' ,
7172 ...swaggerOptions
7273 }
@@ -83,7 +84,7 @@ export const swagger = async <Path extends string = '/swagger'>(
8384 const scalarConfiguration : ReferenceConfiguration = {
8485 spec : {
8586 ...scalarConfig . spec ,
86- url : `/ ${ relativePath } / json`
87+ url : resolve ( reqPath , '/ json' )
8788 } ,
8889 ...scalarConfig
8990 }
You can’t perform that action at this time.
0 commit comments