Open-source project
domaindrivendev/Swashbuckle.AspNetCore avatar
domaindrivendev/Swashbuckle.AspNetCore

Swashbuckle.AspNetCore: OpenAPI docs generated from your ASP.NET Core code

Swagger tools for documenting API's built on ASP.NET Core

5,498 stars1,338 forksC#MIT

At a glance

What is it?
Swashbuckle.AspNetCore reads your ASP.NET Core application and emits an OpenAPI document plus an embedded swagger-ui, so the docs follow the code. The v10 line is a breaking upgrade, and the README sends you to a migration guide before you touch it.
Who is it for?
Adopt Swashbuckle.AspNetCore if your API is built on ASP.NET Core 8.0.0 or later and you want the OpenAPI document produced from the same code that serves requests, with swagger-ui or Redoc rendered from it. Do not adopt it if you need a code-first client generator in the same package, or if you are on an ASP.NET Core version outside the compatibility table.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly C#, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Swashbuckle.AspNetCore does that hand-written API docs cannot

An ASP.NET Core API already knows its own shape. Route templates, parameter types, model classes and response codes are all declared in code, and they drift the moment someone edits a controller without touching a separate document. Swashbuckle.AspNetCore exists to close that gap: it inspects the application and produces an OpenAPI document from what it finds, then serves a UI over that document.

The README frames the audience narrowly. This is OpenAPI (Swagger) tooling for APIs built with ASP.NET Core, and the pitch is documentation that is "always in sync with the latest code" with minimal coding and maintenance. That is the whole value proposition, and it is a real one for teams whose API surface changes faster than their wiki.

It is not a design-first tool. You do not write an OpenAPI file and generate a server from it. The direction is the reverse: your application is the source of truth, and the document is an artifact of it. If your organisation treats the specification as the contract that must be agreed before implementation, this package works against that workflow rather than for it.

The generator, the embedded UI, and the Microsoft.OpenApi dependency

Two pieces ship together. The first is a generator that walks your application and emits an OpenAPI document. The second is an embedded copy of swagger-ui, which the README describes as "powered by the generated OpenAPI JSON documents". The UI does not contain any knowledge of your API; it fetches the JSON and renders it. That separation matters, because it means the document is usable on its own by anything that speaks OpenAPI.

The compatibility table is the most informative part of the README, and it is worth reading as an architecture statement. Each Swashbuckle version pins three things: a range of ASP.NET Core versions, the OpenAPI specification versions it can emit, and a Microsoft.OpenApi version. The v10 row lists ASP.NET Core >= 8.0.0 and OpenAPI 3.1, 3.0 and 2.0, with 3.0 shown in bold as the default. The v9 and v8 rows list the same ASP.NET Core range for v9 but drop 3.1 from the supported specification versions.

That third column is where the trouble lives. Version 10.0 upgraded the Microsoft.OpenApi dependency to 2.x.x specifically to add OpenAPI 3.1 support, and the README marks this with an important callout: v10 "introduces breaking changes" and points readers to a migration guide. The document model underneath changed, so code that touches the OpenAPI object graph directly is the code most likely to need edits.

Installing Swashbuckle.AspNetCore and getting a first document served

The package is distributed on NuGet, and the README's own badge links to the package page as the download location. The related searches around this project are mostly version and package questions, which fits: installation is a package reference plus service and middleware registration in your application startup.

The README does not print an install command or a registration snippet. It points at the NuGet package page for the package itself and at the v10 migration guide for the API changes between major versions, so those two documents are where the exact identifiers and call signatures should come from. What the README does state is what you get once it is wired up: a generator that produces the OpenAPI JSON document, and an embedded swagger-ui that is powered by that document.

After registration, the UI is reachable at the swagger-ui route the middleware registers, and the raw document is served from the swagger JSON endpoint. Open the UI and you should see your endpoints grouped by controller or route, each with the parameters and response types the generator inferred. If the page loads but the endpoint list is empty, the generator found no operations, which usually means the middleware runs before routing is configured.

The README also notes that once an API can describe itself with an OpenAPI document, other OpenAPI-based tools become available, and it points at swagger-codegen for client generation. That is a pointer to a separate project, not a feature of this package.

Where Swashbuckle.AspNetCore stops being the right tool

The generator infers. It does not understand intent. Anything not expressed in types or attributes has to be supplied by you, and the README's compatibility table is silent on how much annotation work a realistic API needs. The related searches include a phrase about annotations, which suggests that is where people spend their time.

Client generation is the clearest boundary. The README's phrasing is that a self-describing API has "opened the treasure chest of OpenAPI-based tools including a client generator", and it names swagger-codegen as the place to look. If your reason for wanting an OpenAPI document is typed clients for other platforms, you are installing two things, not one, and the second is outside this repository.

Version compatibility is the second boundary, and it is harder to work around. The table pairs each Swashbuckle release with a floor on ASP.NET Core. The v10, v9 and v8 rows all require 8.0.0 or later. A project pinned to an older framework has no row in this table, and the README does not describe a supported path for it.

Finally, there is the upgrade itself. The v10 callout is explicit that the Microsoft.OpenApi 2.x.x dependency carries breaking changes. If your project has custom document filters, schema filters or operation filters that manipulate the OpenAPI object model, those are the parts to audit, because that model is what changed.

Swashbuckle.AspNetCore compared with NSwag and Microsoft.AspNetCore.OpenApi

The related searches put two comparisons next to this project: NSwag and Microsoft.AspNetCore.OpenApi. They are genuinely different in scope.

Microsoft.AspNetCore.OpenApi is the in-box option. It is part of the framework rather than a separate package, and it produces a document. What it does not do, according to the README's description of this project, is ship an embedded UI: Swashbuckle.AspNetCore bundles swagger-ui alongside the generator and serves it from the same middleware pipeline. If you want a browsable, testable page without adding a UI package, that bundling is the difference. The README also lists Redoc as a supported UI in the compatibility table, so the document can be rendered by more than one front end.

NSwag occupies a wider position. It is a code generator as well as a document generator, so it covers the client-generation ground that Swashbuckle.AspNetCore explicitly delegates to swagger-codegen. Choosing between them is mostly a question of whether you want one tool that both documents and generates clients, or a document generator that stays out of the client business and lets you pick a generator separately. This package is firmly the second.

A note on the search phrase about Swashbuckle versus Swagger: Swagger is the specification lineage and the UI project. Swashbuckle.AspNetCore is the ASP.NET Core implementation that emits documents in those formats and embeds that UI. They are not competing products.

Maintenance, the v10 upgrade cost, and the MIT licence

The repository is not archived, and the last push was on 2026-09-16. The most recent release listed is v10.2.3 on 2026-06-22, preceded by v10.2.2 on 2026-06-19 and v10.2.1 on 2026-06-01. Patch releases arriving within days of each other in June indicate an active v10 line, and the repository layout confirms the project is maintained as a multi-package solution, with a solution file, central package management files, a docs directory and a separate perf directory.

The upgrade cost is concentrated in one release. Moving from v9 to v10 means moving Microsoft.OpenApi from the 1.x line to 2.x.x, and the README's callout says plainly that this introduces breaking changes, with a dedicated migration document linked from the README. The v9 and v8 rows in the table still exist, so staying put is a documented option rather than an unsupported one, but it caps you at OpenAPI 3.0 and 2.0 output.

The licence is MIT. That is permissive, and it is the same licence family as the wider .NET ecosystem, which keeps it unremarkable for commercial use. This is a description of the licence terms, not legal advice; if your organisation has a policy on third-party dependencies, the MIT text in the LICENSE file at the repository root is what your reviewers will read.

Editorial conclusion

Adopt Swashbuckle.AspNetCore if your API is built on ASP.NET Core 8.0.0 or later and you want the OpenAPI document produced from the same code that serves requests, with swagger-ui or Redoc rendered from it. Do not adopt it if you need a code-first client generator in the same package, or if you are on an ASP.NET Core version outside the compatibility table. Before upgrading an existing project, read the migration guide the README links for v10 and check your Microsoft.OpenApi dependency, because that bump to 2.x.x is what carries the breaking changes. Then confirm your target framework against the table: the v10 row lists ASP.NET Core >= 8.0.0 and OpenAPI 3.1, 3.0 and 2.0.

Frequently asked questions

What is Swashbuckle.AspNetCore used for?

It generates OpenAPI (Swagger) documents from APIs built with ASP.NET Core and serves an embedded swagger-ui over those documents. The README describes the result as living documentation that stays in sync with the code, with minimal coding and maintenance.

How do I install Swashbuckle.AspNetCore?

It is distributed as a NuGet package, and the README's package badge links to the NuGet page as the download location. Installation is a package reference in your ASP.NET Core project, followed by service registration and middleware wiring in your application startup.

What is the difference between Swashbuckle and Swagger?

Swagger is the specification and UI lineage; Swashbuckle.AspNetCore is the ASP.NET Core implementation that generates documents in Swagger 2.0 and OpenAPI 3.0/3.1 formats and embeds the swagger-ui project to render them. The README treats them as complementary, not competing.

How does Swashbuckle.AspNetCore compare with NSwag?

NSwag covers client generation as well as document generation. Swashbuckle.AspNetCore generates the document and serves a UI, and the README directs anyone wanting generated clients to the separate swagger-codegen project instead.

What does Swashbuckle.AspNetCore do?

It provides an OpenAPI generator for ASP.NET Core APIs and an embedded swagger-ui powered by the generated JSON documents. The README states that it supports Swagger 2.0 and OpenAPI 3.0/3.1 output.

What is Swashbuckle.AspNetCore?

It is OpenAPI (Swagger) tooling for APIs built with ASP.NET Core, distributed as a NuGet package under the MIT licence. It generates an OpenAPI document from your application code and serves a UI over it.

Official sources

  1. domaindrivendev/Swashbuckle.AspNetCore on GitHub
  2. Issues
  3. License: MIT
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/domaindrivendev-swashbuckle-aspnetcore.svg)](https://hysenlabs.com/projects/domaindrivendev-swashbuckle-aspnetcore)