18.0: Swagger Setup

Install and Setup Swagger

In this section, we set up Swagger, a tool that allows us to visualize all the endpoints of our API and easily test them.

  1. In Visual Studio, go to Tools -> NuGet Package Manager -> Package Manager Console

  2. Make sure ElevenNote.WebAPI is set as the default project

  3. Type install-package swashbuckle

    • Triple check that your default project is ElevenNote.WebAPI before you hit enter, my selection kept jumping to Models

    • Hit Enter

      Swashbuckle

  4. When it's finished installing, close the Package Manager Console

  5. Go to ElevenNote.WebAPI -> App_Start -> SwaggerConfig.cs

  6. Replace the entire contents of the file with this code.

  7. Git

Next, we'll test endpoints in Swagger.

Last updated