I am building an app that has public API and internal one. I would like to publish docs for these to different routes. I thought this would be accomplished by adding only certain tags to document (addTag
) but after further reading and experiments it does not do the job.
The docs always contain everything, all documented endpoints from all modules.
Is this even possible? If so, how?
I don't believe code is necessary but FWIW:
const pubOptions = new DocumentBuilder()
.setTitle('Pub API Docs')
.setDescription('Blah blah API documentation')
.setVersion(p.version)
.addBearerAuth()
.addTag('public-app')
.build();
const document = SwaggerModule.createDocument(app, pubOptions);
SwaggerModule.setup('public-api', app, document);
const internalOptions = new DocumentBuilder()
.setTitle('Internal API Docs')
.setDescription('Blah blah API documentation')
.setVersion(p.version)
.addBearerAuth()
.addTag('internal')
.build();
const iDocument = SwaggerModule.createDocument(app, internalOptions);
SwaggerModule.setup('internal-api', app, iDocument);