SwaggerUI setup ASP.NET Core Web API



This content originally appeared on DEV Community and was authored by Sharad Aade

1) Select the ASP.NET Core Web API project template

2) Enable OpenAPI support

3) Install Swashbuckle.AspNetCore.SwaggerUI package from NuGet Package Manager

4) In the Properties > launchsettings.json file, enable and add
"launchBrowser": true,
"launchUrl": "swagger",

5) Configure in the program.cs
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/openapi/v1.json", "api");
});

6) That’s all, run the project.

Thank you! (This is not a step you need to follow.)


This content originally appeared on DEV Community and was authored by Sharad Aade