Member-only story
Goodbye Swagger: How .NET 9 is Redefining API Documentation?
With the upcoming release of .NET 9, Microsoft is changing how API documentation is handled within the framework. Swagger, the widely used API documentation tool that has been included in Web API templates for years, will be removed from the initial .NET 9 Web API template. Developers will need to change their approach to describing and visualizing API endpoints. But why did this transition occur, and what are the implications for .NET developers?
Why Is Microsoft Removing Swagger?
Microsoft has announced that Swagger integration in the standard Web API template would be discontinued due to a lack of ongoing Swashbuckle maintenance. The Swashbuckle.AspNetCore
package is widely used to generate Swagger documentation. Instead, .NET 9 will ship with the Microsoft.AspNetCore.OpenApi
library by default, giving a standardized mechanism to build OpenAPI documents directly from the framework.
However, unlike Swagger, which has long provided an interactive UI for displaying API endpoints, Microsoft.AspNetCore.OpenApi
doesn’t have a user interface. This means that developers will have to take extra steps if they want to get a visual depiction of their API endpoints.
The easiest way to understand the difference is: