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 1
1
# SwaggerUI configuration
2
2
3
-
4
3
## Registering services at Startup (with xml documentation)
5
4
6
5
``` csharp
@@ -24,13 +23,13 @@ public void ConfigureServices(IServiceCollection services)
24
23
25
24
public void Configure (WebApplication app )
26
25
{
27
- app .AddUseSwaggerUI (" My Web Api v1" );
26
+ app .UseSwaggerUI (" My Web Api v1" );
27
+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
28
28
}
29
29
```
30
30
31
31
<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.
32
32
33
-
34
33
## Registering services at Startup (without xml documentation)
35
34
36
35
``` csharp
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ public void ConfigureServices(IServiceCollection services)
24
24
25
25
public void Configure (WebApplication app )
26
26
{
27
- app .AddUseSwaggerUI (" My Web Api v1" );
27
+ app .UseSwaggerUI (" My Web Api v1" );
28
+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
28
29
}
29
30
```
30
31
@@ -51,6 +52,7 @@ public void ConfigureServices(IServiceCollection services)
51
52
52
53
public void Configure (WebApplication app )
53
54
{
54
- app .AddUseSwaggerUI (" My Web Api v1" );
55
+ app .UseSwaggerUI (" My Web Api v1" );
56
+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
55
57
}
56
58
```
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ public void ConfigureServices(IServiceCollection services)
24
24
25
25
public void Configure (WebApplication app )
26
26
{
27
- app .AddUseSwaggerUI (" My Web Api v1" );
27
+ app .UseSwaggerUI (" My Web Api v1" );
28
+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
28
29
}
29
30
```
30
31
@@ -51,6 +52,7 @@ public void ConfigureServices(IServiceCollection services)
51
52
52
53
public void Configure (WebApplication app )
53
54
{
54
- app .AddUseSwaggerUI (" My Web Api v1" );
55
+ app .UseSwaggerUI (" My Web Api v1" );
56
+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
55
57
}
56
58
```
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ public void ConfigureServices(IServiceCollection services)
24
24
25
25
public void Configure (WebApplication app )
26
26
{
27
- app .AddUseSwaggerUI (" My Web Api v1" );
27
+ app .UseSwaggerUI (" My Web Api v1" );
28
+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
28
29
}
29
30
```
30
31
@@ -51,6 +52,7 @@ public void ConfigureServices(IServiceCollection services)
51
52
52
53
public void Configure (WebApplication app )
53
54
{
54
- app .AddUseSwaggerUI (" My Web Api v1" );
55
+ app .UseSwaggerUI (" My Web Api v1" );
56
+ // OR app.UseSwaggerUINoEmptyRoutePrefix("My Web Api v1");
55
57
}
56
58
```
You can’t perform that action at this time.
0 commit comments