From 258b0d4562538a1524cc4173cc50f58b03d44947 Mon Sep 17 00:00:00 2001 From: Ahmed Samir Date: Fri, 27 Mar 2026 03:43:48 +0400 Subject: [PATCH 1/2] Fix Swagger UI configuration to use NSwag instead of Swashbuckle The tutorial code used Swashbuckle's UseSwaggerUI() method, but the project already has NSwag.AspNetCore installed. This caused a compilation error since the method wasn't available. --- .../first-mongo-app/samples/9.x/BookStoreApi/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/tutorials/first-mongo-app/samples/9.x/BookStoreApi/Program.cs b/aspnetcore/tutorials/first-mongo-app/samples/9.x/BookStoreApi/Program.cs index 772d2912fad6..0260561c3aa5 100644 --- a/aspnetcore/tutorials/first-mongo-app/samples/9.x/BookStoreApi/Program.cs +++ b/aspnetcore/tutorials/first-mongo-app/samples/9.x/BookStoreApi/Program.cs @@ -31,9 +31,9 @@ if (app.Environment.IsDevelopment()) { app.MapOpenApi(); - app.UseSwaggerUI(options => + app.UseSwaggerUi(options => { - options.SwaggerEndpoint("/openapi/v1.json", "v1"); + options.DocumentPath = "/openapi/v1.json"; }); } // From 74382bc6f672da1b24e704b678453ae721622338 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Mon, 30 Mar 2026 14:47:19 -0700 Subject: [PATCH 2/2] Remove Swashbuckle.AspNetCore package reference Removed Swashbuckle.AspNetCore package reference since it is not used for the 9.x version of this sample. --- .../first-mongo-app/samples/9.x/BookStoreApi/BookStoreApi.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/aspnetcore/tutorials/first-mongo-app/samples/9.x/BookStoreApi/BookStoreApi.csproj b/aspnetcore/tutorials/first-mongo-app/samples/9.x/BookStoreApi/BookStoreApi.csproj index 97f8494543db..d478805fff4c 100644 --- a/aspnetcore/tutorials/first-mongo-app/samples/9.x/BookStoreApi/BookStoreApi.csproj +++ b/aspnetcore/tutorials/first-mongo-app/samples/9.x/BookStoreApi/BookStoreApi.csproj @@ -10,7 +10,6 @@ -