📦domaindrivendev / Swashbuckle.AspNetCore
← 返回首页
Swagger tools for documenting API's built on ASP.NET Core
⚖️ MIT📅 创建于 2015-03-16🔄 更新于 2026-10-28

📄 仓库 README

在 GitHub 查看 ↗
来自 GitHub 仓库自述文件 · 版权归原作者所有

Swashbuckle.AspNetCore

[![NuGet][package-badge-version]][package-download] [![NuGet Downloads][package-badge-downloads]][package-download]

[![Build status][build-badge]][build-status] [![Code coverage][coverage-badge]][coverage-report] [![OpenSSF Scorecard][scorecard-badge]][scorecard-report]

[![Help Wanted][help-wanted-badge]][help-wanted-issues]

[OpenAPI][swagger] (Swagger) tooling for APIs built with ASP.NET Core.

Generate beautiful API documentation, including a UI to explore and test operations, directly from your application code.

In addition to its [Swagger 2.0 and OpenAPI 3.0/3.1][swagger-specification] generator, Swashbuckle.AspNetCore also provides an embedded version of the awesome [swagger-ui][swagger-ui] project that's powered by the generated OpenAPI JSON documents. This means you can complement your API with living documentation that's always in sync with the latest code. Best of all, it requires minimal coding and maintenance, allowing you to focus on building an awesome API.

But that's not all!

Once you have an API that can describe itself with a OpenAPI document, you've opened the treasure chest of OpenAPI-based tools including a client generator that can be targeted to a wide range of popular platforms. See [swagger-codegen][swagger-codegen] for more details.

[!IMPORTANT]
Version 10.0 of Swashbuckle.AspNetCore introduces breaking changes due to upgrading our dependency on [Microsoft.OpenApi][microsoft-openapi] to version 2.x.x to add support for generating OpenAPI 3.1 documents. Please see [Migrating to Swashbuckle.AspNetCore v10][v10-migration] for more details.

Compatibility

Swashbuckle Version ASP.NET Core OpenAPI/Swagger Versions Microsoft.OpenApi swagger-ui Redoc
CI Swashbuckle.AspNetCore version >= 8.0.0 3.1, 3.0, 2.0 Microsoft.OpenApi version swagger-ui version Redoc version
Latest Swashbuckle.AspNetCore version >= 8.0.0 3.1, 3.0, 2.0 Microsoft.OpenApi version swagger-ui version Redoc version
Last v9 Swashbuckle.AspNetCore version 9.0.x, 8.0.x 3.0, 2.0 Microsoft.OpenApi version swagger-ui version Redoc version
Last v8 Swashbuckle.AspNetCore version 9.0.x, 8.0.x, 2.3.x 3.0, 2.0 Microsoft.OpenApi version swagger-ui version Redoc version

Getting Started

First install the kitchen-sink NuGet package into your ASP.NET Core application:

dotnet add package Swashbuckle.AspNetCore

Next, register the OpenAPI (Swagger) generator in your application's startup path, defining one or more OpenAPI documents. For example:

```cs using Microsoft.OpenApi;

var builder = WebApplication.CreateBuilder(args);

bu

📈 近 7 天 Star 趋势

每日新增 Star(柱)与累计 Star(线)· 数据来自 GitHub

🏆 排名变化趋势

在各榜单中的排名历史(数字越小越靠前)

📋 历史上榜记录

每次快照的详细数据
日期 榜单 排名 周期新增 总 STAR