Skip to content

Commit ddce1bc

Browse files
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 <wpickett@microsoft.com>
1 parent b0cb813 commit ddce1bc

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

aspnetcore/tutorials/first-mongo-app/samples/9.x/BookStoreApi/BookStoreApi.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.4" />
1111
<PackageReference Include="MongoDB.Driver" Version="3.3.0" />
1212
<PackageReference Include="NSwag.AspNetCore" Version="14.3.0" />
13-
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.0" />
1413
</ItemGroup>
1514

1615
</Project>

aspnetcore/tutorials/first-mongo-app/samples/9.x/BookStoreApi/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
if (app.Environment.IsDevelopment())
3232
{
3333
app.MapOpenApi();
34-
app.UseSwaggerUI(options =>
34+
app.UseSwaggerUi(options =>
3535
{
36-
options.SwaggerEndpoint("/openapi/v1.json", "v1");
36+
options.DocumentPath = "/openapi/v1.json";
3737
});
3838
}
3939
// </snippet_UseSwagger>

0 commit comments

Comments
 (0)