Setting up Swagger in ASP.NET Core
Swagger is one of my favorite tools when building a WebAPI. It’s good to see support quickly coming to ASP.NET Core from the folks at Swashbuckle. For those of you that might be unfamiliar, Swashbuckle is a framework that enables swagger generation in ASP.NET (and now ASP.NET Core).
It’s only in pre-release, so if you have your filters on you might come up empty handed.
- Enter this into your Nuget Console to install:
Install-Package Swashbuckle.AspNetCore -Pre
- Enable Swagger Generation Service:
- Enable Swagger metadata endpoint and (optionally) Swagger UI endpoint
For development purposes I usually always open up Swagger UI. Its insanely useful for web developers on your team that aren’t comfortable (or equipped with the tools) to go spelunking through your WebAPI code.