Skip to content

Commit 5b1dd3c

Browse files
committed
feat: implement rudimentary support for x-tagGroups
1 parent 65b20fc commit 5b1dd3c

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/types.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { OpenAPIV3 } from 'openapi-types'
2-
import type { ReferenceConfiguration } from '@scalar/types'
2+
import type { ReferenceConfiguration, TagGroup } from '@scalar/types'
33
import type { SwaggerUIOptions } from './swagger/types'
44

55
export interface ElysiaSwaggerConfig<Path extends string = '/swagger'> {
@@ -8,11 +8,7 @@ export interface ElysiaSwaggerConfig<Path extends string = '/swagger'> {
88
*
99
* @see https://swagger.io/specification/v2/
1010
*/
11-
documentation?: Omit<
12-
Partial<OpenAPIV3.Document>,
13-
| 'x-express-openapi-additional-middleware'
14-
| 'x-express-openapi-validation-strict'
15-
>
11+
documentation?: ElysiaSwaggerDocumentation
1612
/**
1713
* Choose your provider, Scalar or Swagger UI
1814
*
@@ -117,3 +113,15 @@ export interface ElysiaSwaggerConfig<Path extends string = '/swagger'> {
117113
*/
118114
excludeTags?: string[]
119115
}
116+
117+
interface ElysiaSwaggerDocumentation extends Omit<
118+
Partial<OpenAPIV3.Document>,
119+
| 'x-express-openapi-additional-middleware'
120+
| 'x-express-openapi-validation-strict'
121+
> {
122+
/**
123+
* Group tags in Scalar UI using `x-tagGroups` property
124+
*/
125+
'x-tagGroups'?: TagGroup[]
126+
}
127+

0 commit comments

Comments
 (0)