Aim: Integrate Swagger in .NetCore Web API project
(Visual Studio 2022 + .NET 6)
1: Create new Web API project (without swagger built in integration)
We are not using OpenAPI in built from Demo.
We do all manually for better understanding
2: Install NuGet Package: SwashbuvkleAspNetCore
3: Update Program.cs file
Builder.Services.AddSwaggerGen();
4: Register Middleware
app.UseSwagger();
app.UseSwaggerUI()
To load swagger when we run project/ when we run project, landing page is swagger,
need to update launchsetting.json file.
need to update launchsetting.json file.
- set launchUrl to "swagger"
For step by step detail, watch video.
For step by step detail, watch video.
No comments:
Post a Comment