mirror of
https://github.com/zoriya/elysia-swagger.git
synced 2025-12-06 00:36:10 +00:00
Merge pull request #120 from kaanduraa/feature/excluded-tags
feature: exclude tags
This commit is contained in:
@@ -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<Path> = {
|
||||
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',
|
||||
|
||||
@@ -111,4 +111,9 @@ export interface ElysiaSwaggerConfig<Path extends string = '/swagger'> {
|
||||
* Exclude methods from Swagger
|
||||
*/
|
||||
excludeMethods?: string[]
|
||||
|
||||
/**
|
||||
* Exclude tags from Swagger or Scalar
|
||||
*/
|
||||
excludeTags?: string[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user