Introduction

Completed

There are many benefits to documenting the software you build. Not only does solid documentation make your code more maintainable over time, it also makes it more consumable by others. Making your code more consumable is especially important when you have an API that others want to use. Thankfully, there are tools and frameworks available that reduce the cost of producing good documentation.

Suppose you're the lead developer for a print framing business. Your company decides to make its APIs publicly available. Many of the APIs have no existing documentation, and it's your responsibility to document them. Documenting the APIs makes it easier for your partners to use them correctly, which results in lower support and maintenance costs.

You need an easy and standardized way of documenting each API. You also need a method of hosting the documentation in a location that is accessible for the partners.

In this module, you learn how to document an existing ASP.NET Core API using Swashbuckle, Swagger, Swagger UI, and OpenAPI.

Learning objectives

In this module, you will:

  • Learn about Swashbuckle, OpenAPI, and Swagger UI.
  • Enable OpenAPI for an C#/ASP.NET Core API.
  • Use Swashbuckle in an C#/ASP.NET Core API.
  • Generate and view API documentation, with OpenAPI.

Prerequisites

  • Experience with REST API design and implementation.
  • Experience developing basic ASP.NET Core apps.
  • Local installations of .NET SDK, Visual Studio Code, and the C# extension for Visual Studio Code.