File tree 2 files changed +64
-2
lines changed
2 files changed +64
-2
lines changed Original file line number Diff line number Diff line change
1
+ import { Elysia , InternalRoute } from 'elysia'
2
+ import { swagger } from '../src/index'
3
+ import { plugin } from './plugin'
4
+ import { registerSchemaPath } from '../src/utils'
5
+
6
+ const app = new Elysia ( )
7
+ . use (
8
+ swagger ( {
9
+ provider : 'scalar' ,
10
+ documentation : {
11
+ info : {
12
+ title : 'Elysia Scalar' ,
13
+ version : '0.8.1'
14
+ } ,
15
+ tags : [
16
+ {
17
+ name : 'Test' ,
18
+ description : 'Hello'
19
+ }
20
+ ] ,
21
+ paths : {
22
+ "/b/" : {
23
+ get : {
24
+ operationId : "getB" ,
25
+ summary : "Ping Pong B" ,
26
+ description : "Lorem Ipsum Dolar" ,
27
+ tags : [ "Test" ] ,
28
+ responses : {
29
+ "200" : {
30
+ description : "test"
31
+ } ,
32
+ } ,
33
+ } ,
34
+ } ,
35
+ } ,
36
+ components : {
37
+ schemas : {
38
+ User : {
39
+ description : 'string'
40
+ }
41
+ } ,
42
+ securitySchemes : {
43
+ JwtAuth : {
44
+ type : 'http' ,
45
+ scheme : 'bearer' ,
46
+ bearerFormat : 'JWT' ,
47
+ description : 'Enter JWT Bearer token **_only_**'
48
+ }
49
+ }
50
+ }
51
+ } ,
52
+ swaggerOptions : {
53
+ persistAuthorization : true
54
+ }
55
+ } )
56
+ )
57
+ . use ( plugin )
58
+ . listen ( 3000 )
59
+
60
+ console . log ( app . rsaoutes )
Original file line number Diff line number Diff line change @@ -143,10 +143,12 @@ export const swagger =
143
143
...documentation . info
144
144
}
145
145
} ,
146
- paths : filterPaths ( schema , {
146
+ paths : { ... filterPaths ( schema , {
147
147
excludeStaticFile,
148
148
exclude : Array . isArray ( exclude ) ? exclude : [ exclude ]
149
- } ) ,
149
+ } ) ,
150
+ ...documentation . paths
151
+ } ,
150
152
components : {
151
153
...documentation . components ,
152
154
schemas : {
You can’t perform that action at this time.
0 commit comments