.NET Core API with Swagger

I think we all can be honest and say that swagger is the most helpful tool when developing an API. Sometimes it’s a hassle to install it. Personally, I would like it to be included in the API template of Visual Studio. So #vs2019 if you are reading, add it to the template, please.

Creating the API using Visual Studio 2019

Next, give it a name.

Next, choose the API template.

Installing the NuGet packages

You need to install the Swashbuckle package for ASP Core.

Adding the lines of code

Testing