Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit d2bc8f0

Browse files
committed
Aggiornata configurazione SwaggerUI
1 parent 2d199c4 commit d2bc8f0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/NET6CustomLibrary/Swagger/SwaggerOptions.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public static class SwaggerOptions
44
{
5-
public static WebApplication AddUseSwaggerUI(this WebApplication app, string title)
5+
public static WebApplication UseSwaggerUI(this WebApplication app, string title)
66
{
77
app.UseSwagger();
88
app.UseSwaggerUI(options =>
@@ -13,4 +13,15 @@ public static WebApplication AddUseSwaggerUI(this WebApplication app, string tit
1313

1414
return app;
1515
}
16+
17+
public static WebApplication UseSwaggerUINoEmptyRoutePrefix(this WebApplication app, string title)
18+
{
19+
app.UseSwagger();
20+
app.UseSwaggerUI(options =>
21+
{
22+
options.SwaggerEndpoint("/swagger/v1/swagger.json", $"{title}");
23+
});
24+
25+
return app;
26+
}
1627
}

0 commit comments

Comments
 (0)