From 5b1dd3c58dc178f96b5b4c1d2cea24ac39ec2f2f Mon Sep 17 00:00:00 2001 From: Alex4386 Date: Fri, 28 Mar 2025 18:06:15 +0900 Subject: [PATCH] feat: implement rudimentary support for `x-tagGroups` --- src/types.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/types.ts b/src/types.ts index 5370e38..3f73d3f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,5 @@ import type { OpenAPIV3 } from 'openapi-types' -import type { ReferenceConfiguration } from '@scalar/types' +import type { ReferenceConfiguration, TagGroup } from '@scalar/types' import type { SwaggerUIOptions } from './swagger/types' export interface ElysiaSwaggerConfig { @@ -8,11 +8,7 @@ export interface ElysiaSwaggerConfig { * * @see https://swagger.io/specification/v2/ */ - documentation?: Omit< - Partial, - | 'x-express-openapi-additional-middleware' - | 'x-express-openapi-validation-strict' - > + documentation?: ElysiaSwaggerDocumentation /** * Choose your provider, Scalar or Swagger UI * @@ -117,3 +113,15 @@ export interface ElysiaSwaggerConfig { */ excludeTags?: string[] } + +interface ElysiaSwaggerDocumentation extends Omit< + Partial, + | 'x-express-openapi-additional-middleware' + | 'x-express-openapi-validation-strict' +> { + /** + * Group tags in Scalar UI using `x-tagGroups` property + */ + 'x-tagGroups'?: TagGroup[] +} +