From 1836ecd8eb1589c7d91592c7153f84f4c78d7637 Mon Sep 17 00:00:00 2001 From: guardrex <1622880+guardrex@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:04:25 -0400 Subject: [PATCH] Remove Nswag/Swagger --- .../Identity/CookieAuthenticationStateProvider.cs | 3 ++- .../Backend/Backend.csproj | 2 +- .../Backend/Program.cs | 9 ++++----- .../Identity/CookieAuthenticationStateProvider.cs | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/8.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/CookieAuthenticationStateProvider.cs b/8.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/CookieAuthenticationStateProvider.cs index e69c860e5..8a8fc9305 100644 --- a/8.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/CookieAuthenticationStateProvider.cs +++ b/8.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/CookieAuthenticationStateProvider.cs @@ -1,9 +1,10 @@ +using System.Net; using System.Net.Http.Json; using System.Security.Claims; +using System.Text; using System.Text.Json; using Microsoft.AspNetCore.Components.Authorization; using BlazorWasmAuth.Identity.Models; -using System.Text; namespace BlazorWasmAuth.Identity { diff --git a/9.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Backend.csproj b/9.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Backend.csproj index 5ca700710..4015a857c 100644 --- a/9.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Backend.csproj +++ b/9.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Backend.csproj @@ -9,8 +9,8 @@ + - diff --git a/9.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Program.cs b/9.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Program.cs index 968b2b789..9499ae813 100644 --- a/9.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Program.cs +++ b/9.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Program.cs @@ -56,8 +56,8 @@ // add services to the container builder.Services.AddEndpointsApiExplorer(); -// add NSwag services -builder.Services.AddOpenApiDocument(); +// add OpenAPI services +builder.Services.AddOpenApi(); var app = builder.Build(); @@ -67,9 +67,8 @@ await using var scope = app.Services.CreateAsyncScope(); await SeedData.InitializeAsync(scope.ServiceProvider); - // add OpenAPI/Swagger generator and the Swagger UI - app.UseOpenApi(); - app.UseSwaggerUi(); + // resolve OpenAPI document + app.MapOpenApi(); } // create routes for the identity endpoints diff --git a/9.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/CookieAuthenticationStateProvider.cs b/9.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/CookieAuthenticationStateProvider.cs index e69c860e5..8a8fc9305 100644 --- a/9.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/CookieAuthenticationStateProvider.cs +++ b/9.0/BlazorWebAssemblyStandaloneWithIdentity/BlazorWasmAuth/Identity/CookieAuthenticationStateProvider.cs @@ -1,9 +1,10 @@ +using System.Net; using System.Net.Http.Json; using System.Security.Claims; +using System.Text; using System.Text.Json; using Microsoft.AspNetCore.Components.Authorization; using BlazorWasmAuth.Identity.Models; -using System.Text; namespace BlazorWasmAuth.Identity {