Skip to content

Commit 71359e7

Browse files
authored
Remove Nswag/Swagger (#566)
1 parent c9542f6 commit 71359e7

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

8.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/CookieAuthenticationStateProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
using System.Net;
12
using System.Net.Http.Json;
23
using System.Security.Claims;
4+
using System.Text;
35
using System.Text.Json;
46
using Microsoft.AspNetCore.Components.Authorization;
57
using BlazorWasmAuth.Identity.Models;
6-
using System.Text;
78

89
namespace BlazorWasmAuth.Identity
910
{

9.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Backend.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0" />
12+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.7" />
1213
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.0" />
13-
<PackageReference Include="NSwag.AspNetCore" Version="14.1.0" />
1414
</ItemGroup>
1515

1616
</Project>

9.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Program.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
// add services to the container
5757
builder.Services.AddEndpointsApiExplorer();
5858

59-
// add NSwag services
60-
builder.Services.AddOpenApiDocument();
59+
// add OpenAPI services
60+
builder.Services.AddOpenApi();
6161

6262
var app = builder.Build();
6363

@@ -67,9 +67,8 @@
6767
await using var scope = app.Services.CreateAsyncScope();
6868
await SeedData.InitializeAsync(scope.ServiceProvider);
6969

70-
// add OpenAPI/Swagger generator and the Swagger UI
71-
app.UseOpenApi();
72-
app.UseSwaggerUi();
70+
// resolve OpenAPI document
71+
app.MapOpenApi();
7372
}
7473

7574
// create routes for the identity endpoints

9.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/CookieAuthenticationStateProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
using System.Net;
12
using System.Net.Http.Json;
23
using System.Security.Claims;
4+
using System.Text;
35
using System.Text.Json;
46
using Microsoft.AspNetCore.Components.Authorization;
57
using BlazorWasmAuth.Identity.Models;
6-
using System.Text;
78

89
namespace BlazorWasmAuth.Identity
910
{

0 commit comments

Comments
 (0)