diff --git a/src/index.ts b/src/index.ts index ec5d1da..a247e45 100644 --- a/src/index.ts +++ b/src/index.ts @@ -30,7 +30,8 @@ export const swagger = swaggerOptions = {}, theme = `https://unpkg.com/swagger-ui-dist@${version}/swagger-ui.css`, autoDarkMode = true, - excludeMethods = ['OPTIONS'] + excludeMethods = ['OPTIONS'], + excludeTags = [] }: ElysiaSwaggerConfig = { provider: 'scalar', scalarVersion: 'latest', @@ -43,7 +44,8 @@ export const swagger = exclude: [], swaggerOptions: {}, autoDarkMode: true, - excludeMethods: ['OPTIONS'] + excludeMethods: ['OPTIONS'], + excludeTags: [] } ) => (app: Elysia) => { @@ -136,6 +138,7 @@ export const swagger = openapi: '3.0.3', ...{ ...documentation, + tags: documentation.tags?.filter((tag) => !excludeTags?.includes(tag?.name)), info: { title: 'Elysia Documentation', description: 'Development documentation', diff --git a/src/types.ts b/src/types.ts index e2bd09c..1c41e04 100644 --- a/src/types.ts +++ b/src/types.ts @@ -111,4 +111,9 @@ export interface ElysiaSwaggerConfig { * Exclude methods from Swagger */ excludeMethods?: string[] + + /** + * Exclude tags from Swagger or Scalar + */ + excludeTags?: string[] }