File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ export const swagger =
30
30
swaggerOptions = { } ,
31
31
theme = `https://unpkg.com/swagger-ui-dist@${ version } /swagger-ui.css` ,
32
32
autoDarkMode = true ,
33
- excludeMethods = [ 'OPTIONS' ]
33
+ excludeMethods = [ 'OPTIONS' ] ,
34
+ excludeTags = [ ]
34
35
} : ElysiaSwaggerConfig < Path > = {
35
36
provider : 'scalar' ,
36
37
scalarVersion : 'latest' ,
@@ -43,7 +44,8 @@ export const swagger =
43
44
exclude : [ ] ,
44
45
swaggerOptions : { } ,
45
46
autoDarkMode : true ,
46
- excludeMethods : [ 'OPTIONS' ]
47
+ excludeMethods : [ 'OPTIONS' ] ,
48
+ excludeTags : [ ]
47
49
}
48
50
) =>
49
51
( app : Elysia ) => {
@@ -136,6 +138,7 @@ export const swagger =
136
138
openapi : '3.0.3' ,
137
139
...{
138
140
...documentation ,
141
+ tags : documentation . tags ?. filter ( ( tag ) => ! excludeTags ?. includes ( tag ?. name ) ) ,
139
142
info : {
140
143
title : 'Elysia Documentation' ,
141
144
description : 'Development documentation' ,
Original file line number Diff line number Diff line change @@ -111,4 +111,9 @@ export interface ElysiaSwaggerConfig<Path extends string = '/swagger'> {
111
111
* Exclude methods from Swagger
112
112
*/
113
113
excludeMethods ?: string [ ]
114
+
115
+ /**
116
+ * Exclude tags from Swagger or Scalar
117
+ */
118
+ excludeTags ?: string [ ]
114
119
}
You can’t perform that action at this time.
0 commit comments