File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change
1
+ # 1.3.1
2
+ Bug fix:
3
+ - Using relative path for specPath
4
+
1
5
# 1.3.0-exp.1 - 1 May 2025
2
6
Improvement:
3
7
- use static response for documentation page
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const schema = t.Object({
5
5
test : t . Literal ( 'hello' )
6
6
} )
7
7
8
- const app = new Elysia ( )
8
+ const app = new Elysia ( { prefix : '/api' } )
9
9
. use (
10
10
swagger ( {
11
11
provider : 'scalar' ,
@@ -52,7 +52,7 @@ const app = new Elysia()
52
52
}
53
53
)
54
54
. post ( '/json' , ( { body } ) => body , {
55
- parse : ' formdata',
55
+ parse : [ 'json' , ' formdata'] ,
56
56
body : 'schema' ,
57
57
response : 'schema'
58
58
} )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @elysiajs/swagger" ,
3
- "version" : " 1.3.0 " ,
3
+ "version" : " 1.3.1 " ,
4
4
"description" : " Plugin for Elysia to auto-generate Swagger page" ,
5
5
"author" : {
6
6
"name" : " saltyAom" ,
73
73
"openapi-types" : " ^12.1.3" ,
74
74
"pathe" : " ^1.1.2"
75
75
}
76
- }
76
+ }
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export const swagger = <Path extends string = '/swagger'>({
45
45
...documentation . info
46
46
}
47
47
48
- const relativePath = path . startsWith ( '/' ) ? path . slice ( 1 ) : path
48
+ const relativePath = specPath . startsWith ( '/' ) ? specPath . slice ( 1 ) : specPath
49
49
50
50
const app = new Elysia ( { name : '@elysiajs/swagger' } )
51
51
@@ -57,7 +57,7 @@ export const swagger = <Path extends string = '/swagger'>({
57
57
theme ,
58
58
JSON . stringify (
59
59
{
60
- url : specPath ,
60
+ url : relativePath ,
61
61
dom_id : '#swagger-ui' ,
62
62
...swaggerOptions
63
63
} ,
@@ -71,8 +71,8 @@ export const swagger = <Path extends string = '/swagger'>({
71
71
scalarVersion ,
72
72
{
73
73
spec : {
74
- ... scalarConfig . spec ,
75
- url : specPath
74
+ url : relativePath ,
75
+ ... scalarConfig . spec
76
76
} ,
77
77
...scalarConfig ,
78
78
// so we can showcase the elysia theme
You can’t perform that action at this time.
0 commit comments