This post is an overview of how to install and configure Swagger for .NET Core. If you are searching for tips & tricks, you might be interested in the article: Swagger in .NET Core: Tips & Tricks.

What is Swagger

Swagger is an open-source software framework backed by a large ecosystem of tools that helps developers design, build, document, and consume RESTful web services. While most users identify Swagger by the Swagger UI tool, the Swagger toolset includes support for automated documentation, code generation, and test-case generation.

Some of these tools are:

  • Swagger Editor: Swagger Editor lets you edit OpenAPI specifications in YAML inside your browser and to preview documentations in real time.
  • Swagger UI: Swagger UI is a collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from an OAS-compliant API.
  • Swagger Codegen: Allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an OpenAPI Spec.
  • Swagger Inspector: API Inspection tool that lets you generate OpenAPI definitions from existing API
  • SwaggerHub: API design and documentation, built for teams working with OpenAPI.

Swagger for .NET Core

Swagger for .NET Core comes by the name Swashbuckle.AspNetCore, and it is actually composed of three components which you can potentially install seperately:

  • Swashbuckle.AspNetCore.Swagger: a Swagger object model and middleware to expose SwaggerDocument objects as JSON endpoints.
  • Swashbuckle.AspNetCore.SwaggerGen: a Swagger generator that builds SwaggerDocument objects directly from your routes, controllers, and models. It’s typically combined with the Swagger endpoint middleware to automatically expose Swagger JSON.
  • Swashbuckle.AspNetCore.SwaggerUI: an embedded version of the Swagger UI tool. It interprets Swagger JSON to build a rich, customizable experience for describing the web API functionality. It includes built-in test harnesses for the public methods.

#asp.net core #dotnet #dotnet core aspnetcore #swagger #swashbuckle

Get started with Swagger and ASP.NET Core
1.55 GEEK