attachTagGroups(document)

Adds the x-tagGroups extension to a Swagger document, built from the groups registered via docs({ group, tags }).

Usage

Call it after SwaggerModule.createDocument() and before SwaggerModule.setup(). Returns the document unchanged if no group was registered. See Tag groups for a complete example.

main.ts
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { attachTagGroups } from 'nestjs-docfy';

const config = new DocumentBuilder().setTitle('My API').build();
const document = SwaggerModule.createDocument(app, config);

SwaggerModule.setup('api', app, attachTagGroups(document));