Skip to content

About

The official continuation of LEGO.AsyncAPI.NET from the original author and maintainer. The SDK contains a useful object model for AsyncAPI 3.0 documents in .NET

Topics

Resources

Code of conduct

Contributing

Stars

17 stars

Watchers

1 watching

Forks

Repository files navigation

AsyncAPI.NET

Build & Test

AsyncAPI.NET provides a .NET object model for AsyncAPI documents, JSON/YAML readers and writers, and protocol bindings.

It supports AsyncAPI 2.x and 3.x. V2 documents are upgraded to the V3-shaped model when read and can be written back as V2. Serialization currently emits 2.6 or 3.1.0; the V3 selector is still named AsyncApiVersion.AsyncApi3_0.

See the documentation site for guides and examples, or the changelog for release notes.

Install

Install the core model and serializers, plus the readers for JSON/YAML input:

dotnet add package ByteBard.AsyncAPI.NET
dotnet add package ByteBard.AsyncAPI.NET.Readers

For protocol bindings, also install:

dotnet add package ByteBard.AsyncAPI.NET.Bindings

Binding readers require explicit registration; see protocol bindings.

Quick start

Parse YAML, check diagnostics, and write JSON (C# 11 or later):

using System;
using ByteBard.AsyncAPI;
using ByteBard.AsyncAPI.Models;
using ByteBard.AsyncAPI.Readers;

var source = """
asyncapi: 3.1.0
info:
  title: Example API
  version: 1.0.0
channels: {}
""";

var document = new AsyncApiStringReader().Read(source, out var diagnostics);

foreach (var error in diagnostics.Errors)
    Console.Error.WriteLine($"Error at {error.Pointer}: {error.Message}");
foreach (var warning in diagnostics.Warnings)
    Console.Error.WriteLine($"Warning at {warning.Pointer}: {warning.Message}");

if (diagnostics.Errors.Count > 0)
    return;

Console.WriteLine(document.SerializeAsJson(AsyncApiVersion.AsyncApi3_0));

Documentation

Contributing

Contributions and suggestions are welcome. See CONTRIBUTING.md and the documentation development instructions.

Attribution

License

Apache 2.0

About

The official continuation of LEGO.AsyncAPI.NET from the original author and maintainer. The SDK contains a useful object model for AsyncAPI 3.0 documents in .NET

Topics

Resources

Code of conduct

Contributing

Stars

17 stars

Watchers

1 watching

Forks

Sponsor this project

Used by

Contributors

Languages