Bielu.AspNetCore.AsyncApi 1.0.0

Prefix Reserved
dotnet add package Bielu.AspNetCore.AsyncApi --version 1.0.0
                    
NuGet\Install-Package Bielu.AspNetCore.AsyncApi -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bielu.AspNetCore.AsyncApi" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bielu.AspNetCore.AsyncApi" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Bielu.AspNetCore.AsyncApi" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bielu.AspNetCore.AsyncApi --version 1.0.0
                    
#r "nuget: Bielu.AspNetCore.AsyncApi, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bielu.AspNetCore.AsyncApi@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bielu.AspNetCore.AsyncApi&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Bielu.AspNetCore.AsyncApi&version=1.0.0
                    
Install as a Cake Tool

About

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

This project is based on and inspired by:

Key Features

  • Serves the generated document at runtime from a parameterized endpoint (/asyncapi/{documentName}.json or .yaml)
  • Emits AsyncAPI 2.6 or 3.1, selected per document
  • Generates the document at build time, so it can be committed and diffed in CI
  • Customizable via document, operation and schema transformers
  • Protocol bindings (AMQP, HTTP, MQTT, Kafka, …), plus first-party SignalR, gRPC, SSE and WebRTC bindings
  • Multiple AsyncAPI documents from a single application
  • Descriptions from XML doc comments, and message examples
  • Native AOT and trimming support via a source-generated metadata provider

How to Use

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

Installation

dotnet add package Bielu.AspNetCore.AsyncApi

Configuration

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

var builder = WebApplication.CreateBuilder();

// Registers the required services
builder.Services.AddAsyncApi(options =>
{
    options.AddServer("mosquitto", "test.mosquitto.org", "mqtt");
    options.WithDefaultContentType("application/json")
        .WithDescription("My API Description");
});

var app = builder.Build();

// Adds the /asyncapi/{documentName}.json endpoint to the application
app.MapAsyncApi();

app.Run();

Viewing the Documentation

The library serves a standard AsyncAPI document at /asyncapi/{documentName}.json, so you can render it with any AsyncAPI-compatible UI. We recommend Scalar, which renders AsyncAPI channels, operations, messages, and schemas alongside your OpenAPI references:

dotnet add package Scalar.AspNetCore
app.MapAsyncApi();

app.MapScalarApiReference(options =>
{
    options.AddAsyncApiDocument("v1", "My API", "/asyncapi/v1.json");
});

Note: Scalar's AsyncAPI support is still evolving; not every part of the specification is rendered yet.

Main Types

The main types provided by this library are:

  • AsyncApiOptions: Options for configuring AsyncAPI document generation.
  • IDocumentTransformer: Transformer that modifies the AsyncAPI document generated by the library.
  • ISchemaTransformer: Transformer that modifies generated schemas.

Feedback & Contributing

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

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on Bielu.AspNetCore.AsyncApi:

Package Downloads
Bielu.AspNetCore.AsyncApi.UI

[DEPRECATED] Built-in AsyncAPI UI for Bielu.AspNetCore.AsyncApi. This package is deprecated — render the AsyncAPI document with Scalar instead (Scalar.AspNetCore + MapScalarApiReference), optionally with Bielu.AspNetCore.AsyncApi.Scalar.SignalR / .Scalar.Grpc for interactive protocol consoles.

Bielu.AspNetCore.AsyncApi.Merger

Tool for merging multiple AsyncAPI documents into a single unified specification. Supports local and remote sources with caching and change detection.

Bielu.AspNetCore.AsyncApi.Extensions.Protocols.SignalR

SignalR protocol bindings for Bielu.AspNetCore.AsyncApi. Adds a custom "signalr" AsyncAPI protocol with channel, operation, message and server bindings.

Bielu.AspNetCore.AsyncApi.Extensions.Protocols.Grpc

gRPC protocol bindings for Bielu.AspNetCore.AsyncApi. Adds a custom "grpc" AsyncAPI protocol with channel, operation, message and server bindings.

Bielu.AspNetCore.AsyncApi.Extensions.Protocols.Sse

Server-Sent Events (SSE) protocol bindings for Bielu.AspNetCore.AsyncApi. Adds a custom "sse" AsyncAPI protocol with channel, operation, message and server bindings.

GitHub repositories

This package is not used by any popular GitHub repositories.