From ddce1bc78fca6a19a07e667c3b86b9e4e0ef6f73 Mon Sep 17 00:00:00 2001 From: Ahmed Samir Date: Tue, 31 Mar 2026 19:40:47 +0400 Subject: [PATCH] Fix Swagger UI configuration to use NSwag instead of Swashbuckle (#36929) * 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. * Remove Swashbuckle.AspNetCore package reference Removed Swashbuckle.AspNetCore package reference since it is not used for the 9.x version of this sample. --------- Co-authored-by: Wade Pickett --- .../samples/9.x/BookStoreApi/BookStoreApi.csproj | 1 - .../first-mongo-app/samples/9.x/BookStoreApi/Program.cs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) 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 @@ - 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"; }); } //