Reputation: 833
We have many services, which use SwashBuckle / Swagger UI to expose REST methods.
It can often be annoying when you have several of them open in tabs in a browser that you cannot immdiately see the service name from the tabs. At least not without switching to that tab
Is it possible to change the HTML title from SwashBuckle?
Upvotes: 15
Views: 3583
Reputation: 18559
For those using NestJs SwaggerModule, changing HTML title is done with property customSiteTitle in SwaggerCustomOptions, which is optional 4th parameter to SwaggerModule.setup
in your main.ts
, if you have line like this:
SwaggerModule.setup('api', app, documentFactory);
change it to:
SwaggerModule.setup('api', app, documentFactory, {customSiteTitle: "Your Title"} );
Upvotes: 0
Reputation: 2378
Yes, Simply change document title
app.UseSwaggerUI(option =>
{
...
option.DocumentTitle = "Your Title";
...
});
Upvotes: 31