diff --git a/src/app.provider.ts b/src/app.provider.ts index 4f0f10c1c3..add15141e6 100644 --- a/src/app.provider.ts +++ b/src/app.provider.ts @@ -1,5 +1,6 @@ import type { INestApplication } from '@nestjs/common'; import { VersioningType } from '@nestjs/common'; +import type { SwaggerDocumentOptions } from '@nestjs/swagger'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { NestFactory } from '@nestjs/core'; import { IConfigurationService } from '@/config/configuration.service.interface'; @@ -26,7 +27,16 @@ function configureSwagger(app: INestApplication): void { .setVersion(configurationService.get('about.version') ?? '') .build(); - const document = SwaggerModule.createDocument(app, config); + const options: SwaggerDocumentOptions = { + operationIdFactory: ( + _: string, + methodKey: string, + version: string | undefined, + ) => + `${version ? version : ''}${methodKey.charAt(0).toUpperCase()}${methodKey.slice(1)}`, + }; + + const document = SwaggerModule.createDocument(app, config, options); SwaggerModule.setup('api', app, document, { customfavIcon: '/favicon.png', customSiteTitle: 'Safe Client Gateway',