Microsoft.AspNetCore.OpenApi
10.0.7
50 download(s)
public
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/dotnet/tree/b16286c2284fecf303dbc12a0bb152476d662e44
aspnetcore
openapi
PackageReference
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.7" />
.NET CLI
dotnet add package Microsoft.AspNetCore.OpenApi --version 10.0.7
Dependencies
net10.0
| Package | Version range |
|---|---|
| Microsoft.OpenApi | [2.0.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
```sh
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.
```C#
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](https://learn.microsoft.com/aspnet/core/fundamentals/minimal-apis/openapi).
## Main Types
<!-- The main types provided in this library -->
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
<!-- How to provide feedback on this package and contribute to it -->
Microsoft.AspNetCore.OpenApi is released as open-source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/aspnetcore).
Versions
Target frameworks
net10.0
Metadata
- Published
- Size
- 170.26 KB
- Authors
- Microsoft
- License
- MIT
- Project
- https://asp.net/
- Repository
- https://github.com/dotnet/dotnet commit b16286c2284fecf303dbc12a0bb152476d662e44
- Flags
- SemVer 1 ยท requires license acceptance
- SHA512
- d6r3x0+16OmxMphiuDBZ4X45NUmv2aqrq2/LB5MpP5Ix5xLEj8WpNo7v61ehzaz6pP59V8HQhB60mVRWzhtNFw==