Skip to main content
net10.0

Provides APIs for annotating route handler endpoints in ASP.NET Core with OpenAPI annotations. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/b225d30209cf027c80b741d04efe1c54f2431b3c

Published
Feb 25, 2025
1y ago
Total Downloads
246.3M
246,317,261

Install

dotnet add package Microsoft.AspNetCore.OpenApi --version 10.0.0-preview.1.25120.3
ProductVersions
.NET
net10.0

README

About

Microsoft.AspNetCore.OpenApi is a NuGet package that provides built-in support for generating OpenAPI documents from minimal or controller-based APIs in ASP.NET Core.

Key Features

  • Supports viewing generated OpenAPI documents at runtime via a parameterized endpoint (/openapi/{documentName}.json)
  • Supports generating an OpenAPI document at build-time
  • Supports customizing the generated document via document transformers

How to Use

To start using Microsoft.AspNetCore.OpenApi in your ASP.NET Core application, follow these steps:

Installation

dotnet add package Microsoft.AspNetCore.OpenApi

Configuration

In your Program.cs file, register the services provided by this package in the DI container and map the provided OpenAPI document endpoint in the application.

var builder = WebApplication.CreateBuilder();

// Registers the required services
builder.Services.AddOpenApi();

var app = builder.Build();

// Adds the /openapi/{documentName}.json endpoint to the application
app.MapOpenApi();

app.Run();

For more information on configuring and using Microsoft.AspNetCore.OpenApi, refer to the official documentation.

Main Types

The main types provided by this library are:

  • OpenApiOptions: Options for configuring OpenAPI document generation.
  • IDocumentTransformer: Transformer that modifies the OpenAPI document generated by the library.

Feedback & Contributing

Microsoft.AspNetCore.OpenApi is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Changes from Previous Version

v9.0.21v10.0.0-preview.1.25120.3
Added Frameworks
net10.0
Removed Frameworks
net9.0
Added Dependencies
Removed Dependencies

Adoption Assessment

Teams staying close to first-party ASP.NET Core primitives and minimal external framework layering.

ASP.NET Core Guide
This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.
Editorial Note: First-party OpenAPI generation support aligned with modern ASP.NET Core hosting patterns. Trade-off: Feature customization depth may require additional conventions or complementary packages.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.