Implementing OpenAPI in ASP.NET Core services

There are two different packages that we can use to implement OpenAPI in ASP.NET Core:

Both of these use middleware to generate and serve the swagger.json file and allow the user interface to browse the service definition. In this section, we will discuss how to integrate NSwag into our vinyl catalog service. The following schema shows how NSwag is plugged into our ASP.NET Core service:

Let's start by adding NSwag.AspNetCore to the Catalog.API project by using the ...

Get Hands-On RESTful Web Services with ASP.NET Core 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.