No Swagger in .NET 9? What Changed & What’s Next
Back in November, .NET 9 officially replaced .NET 8, bringing a batch of new features and updates. One change that stood out? Swagger is no longer included by default in web API templates. Instead of using Swashbuckle, Microsoft introduced a native solution—the Microsoft.AspNetCore.OpenApi.? ? ?
For developers still wondering what's next, this post breaks down what happened to Swagger and explores some great alternatives to add to your toolkit. Ready?
What happened to Swagger?
Swagger has been a go-to tool in the .NET ecosystem for years, making it easy for devs to document and test APIs.
However, with .NET 9, Microsoft took a different approach. Instead of relying on third-party libraries, they introduced a fully native solution. Now, OpenAPI documents can be generated without external dependencies.
What changed? A big factor is Swashbuckle, the library that powers Swagger UI in ASP.NET Core. In recent years, it has faced maintenance challenges—its core contributors stepped back, leading to unresolved bugs, fewer updates, and even a delayed official release for .NET 8. As a result, devs have had to deal with compatibility issues and uncertainty about its future.
At the same time, Microsoft reworked OpenAPI document generation in .NET 9. Instead of using Swashbuckle, they’ve introduced a built-in OpenAPI document generator: Microsoft.AspNetCore.OpenApi. This shift is meant to reduce reliance on third-party tools, improve integration within the .NET ecosystem, and ensure long-term support.
Keep in mind that the new .NET 9 OpenAPI feature only generates OpenAPI specifications—it doesn't provide an interactive UI like Swagger UI. So, if you need an interactive API UI to explore and test endpoints, you'll need to integrate an external tool. We'll get there soon. For now, let's examine what OpenAPI has to offer.
?
The perks of using .NET 9's OpenAPI generator
As mentioned earlier, if you need an interactive API UI, you must pair .NET 9 OpenAPI with an external tool. However, sticking with the built-in tool does come with some notable benefits: ? ?
Want to dig deeper? This in-depth post explores the new functionality, comparing it to NSwag and Swashbuckle to see how it stacks up in terms of features and performance.
Bringing Swagger back
That said, this isn't goodbye—Microsoft didn't remove Swagger entirely; they just dropped the Swashbuckle dependency from their default templates.
Developers can still add it back by installing the NuGet package. In fact, since .NET 9 now generates the OpenAPI spec using Microsoft.AspNetCore.OpenApi, you can simply hook up Swagger UI to read it. To restore it, just install the Swashbuckle.AspNetCore package and configure it in your Program.cs.
We know old habits die hard—so if you want to keep using Swagger, it's easy to bring it back. But this change also opens the door to exploring faster, more innovative alternatives—some of which might better suit your workflow than Swashbuckle ever did.
Alternatives to Swagger for API testing ? ?
The good news is that API documentation tools have evolved significantly, and there are plenty of options to choose from. ? ?
#1. Postman – The all-in-one API tool
Postman remains one of the most popular tools for API testing and development. It equips developers with powerful features to simplify API workflows, including the ability to import OpenAPI specifications.
Besides simplifying testing, Postman provides auto-generated documentation from your OpenAPI spec, making it a strong alternative for testing and documentation.?
#2. NSwag – OpenAPI generation + UI ? ?
NSwag is a powerful OpenAPI tool that provides document generation and an interactive API UI, making it a strong replacement for Swashbuckle. It allows you to generate TypeScript and C# client code from OpenAPI specs, making it particularly useful for API consumers.??
If you're looking for an alternative that supports both OpenAPI generation and an interactive UI, NSwag is worth considering.
#3. Scalar – Lightweight and fast UI ? ?
Scalar has recently gained popularity in the .NET community as a lightweight, open-source alternative to Swagger UI.??
This interactive documentation UI for OpenAPI provides an intuitive interface, making API exploration effortless. Scalar supports OpenAPI and Swagger specifications, ensuring seamless integration with existing API ecosystems.? Learn more here.
#4. Stoplight – API design + collaboration??
Stoplight goes beyond documentation—it's a complete API lifecycle platform that helps teams design, document, and manage APIs collaboratively.??
This tool provides a powerful API-first workflow, making it an excellent choice for teams that need version control, governance, and structured API development.
#5. Redocly – A modern and customizable UI
Redocly is a polished, highly customizable OpenAPI documentation tool that is a strong alternative to Swagger UI.??
One of its standout features is its deep customization options, allowing developers to tailor the look and feel of their API documentation. Redocly fully supports OpenAPI 3.1 and integrates seamlessly into CI/CD pipelines, making it a future-proof solution for API documentation.
Of course, the right choice will depend on your project’s needs and personal preferences. Whether you’re looking for better performance, more customization, or seamless integration, there’s a tool that fits your workflow.
What's in your dev toolkit???
We’ve said it—old habits die hard. If you still prefer Swagger, you can easily restore it. That said, this change is also an opportunity to explore new solutions that might better fit your project. You might even find that switching tools helps streamline development and improve how you work with APIs.?
Did we miss a tool you swear by? We'd love to hear what's in your dev toolkit—drop your picks in the comments!??
Before you head out, don’t forget to subscribe to our newsletter for the latest in .NET, APIs, and dev best practices. And if you're looking for your next big dev challenge, be sure to check out our open positions here.?
See you in the next one!
Staff Associate Engineer
2 天前I wonder why Scalar is so popular, although I've heard a lot from it lately. It's great see to see this kind of move to reduce dependency and make the framework greater