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 =
3030 swaggerOptions = { } ,
3131 theme = `https://unpkg.com/swagger-ui-dist@${ version } /swagger-ui.css` ,
3232 autoDarkMode = true ,
33- excludeMethods = [ 'OPTIONS' ]
33+ excludeMethods = [ 'OPTIONS' ] ,
34+ excludeTags = [ ]
3435 } : ElysiaSwaggerConfig < Path > = {
3536 provider : 'scalar' ,
3637 scalarVersion : 'latest' ,
@@ -43,7 +44,8 @@ export const swagger =
4344 exclude : [ ] ,
4445 swaggerOptions : { } ,
4546 autoDarkMode : true ,
46- excludeMethods : [ 'OPTIONS' ]
47+ excludeMethods : [ 'OPTIONS' ] ,
48+ excludeTags : [ ]
4749 }
4850 ) =>
4951 ( app : Elysia ) => {
@@ -136,6 +138,7 @@ export const swagger =
136138 openapi : '3.0.3' ,
137139 ...{
138140 ...documentation ,
141+ tags : documentation . tags ?. filter ( ( tag ) => ! excludeTags ?. includes ( tag ?. name ) ) ,
139142 info : {
140143 title : 'Elysia Documentation' ,
141144 description : 'Development documentation' ,
Original file line number Diff line number Diff line change @@ -111,4 +111,9 @@ export interface ElysiaSwaggerConfig<Path extends string = '/swagger'> {
111111 * Exclude methods from Swagger
112112 */
113113 excludeMethods ?: string [ ]
114+
115+ /**
116+ * Exclude tags from Swagger or Scalar
117+ */
118+ excludeTags ?: string [ ]
114119}
You can’t perform that action at this time.
0 commit comments