This repository was archived by the owner on Apr 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +14
-9
lines changed
src/NET6CustomLibrary/Docs/Swagger Expand file tree Collapse file tree 4 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 11# SwaggerUI configuration
22
3-
43## Registering services at Startup (with xml documentation)
54
65``` csharp
@@ -24,13 +23,13 @@ public void ConfigureServices(IServiceCollection services)
2423
2524public void Configure (WebApplication app )
2625{
27- app .AddUseSwaggerUI (" My Web Api v1" );
26+ app .UseSwaggerUI (" My Web Api v1" );
27+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
2828 }
2929```
3030
3131<b >Note:</b > If you want to add xml documentation to web api you need to add TRUE value to GenerateDocumentationFile tag to csproj project file.
3232
33-
3433## Registering services at Startup (without xml documentation)
3534
3635``` csharp
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ public void ConfigureServices(IServiceCollection services)
2424
2525public void Configure (WebApplication app )
2626{
27- app .AddUseSwaggerUI (" My Web Api v1" );
27+ app .UseSwaggerUI (" My Web Api v1" );
28+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
2829 }
2930```
3031
@@ -51,6 +52,7 @@ public void ConfigureServices(IServiceCollection services)
5152
5253public void Configure (WebApplication app )
5354{
54- app .AddUseSwaggerUI (" My Web Api v1" );
55+ app .UseSwaggerUI (" My Web Api v1" );
56+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
5557 }
5658```
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ public void ConfigureServices(IServiceCollection services)
2424
2525public void Configure (WebApplication app )
2626{
27- app .AddUseSwaggerUI (" My Web Api v1" );
27+ app .UseSwaggerUI (" My Web Api v1" );
28+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
2829 }
2930```
3031
@@ -51,6 +52,7 @@ public void ConfigureServices(IServiceCollection services)
5152
5253public void Configure (WebApplication app )
5354{
54- app .AddUseSwaggerUI (" My Web Api v1" );
55+ app .UseSwaggerUI (" My Web Api v1" );
56+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
5557 }
5658```
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ public void ConfigureServices(IServiceCollection services)
2424
2525public void Configure (WebApplication app )
2626{
27- app .AddUseSwaggerUI (" My Web Api v1" );
27+ app .UseSwaggerUI (" My Web Api v1" );
28+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
2829 }
2930```
3031
@@ -51,6 +52,7 @@ public void ConfigureServices(IServiceCollection services)
5152
5253public void Configure (WebApplication app )
5354{
54- app .AddUseSwaggerUI (" My Web Api v1" );
55+ app .UseSwaggerUI (" My Web Api v1" );
56+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
5557 }
5658```
You can’t perform that action at this time.
0 commit comments