- Notifications
You must be signed in to change notification settings - Fork18
The AsyncAPI.NET SDK contains a useful object model for AsyncAPI documents in .NET
License
LEGO/AsyncAPI.NET
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The AsyncAPI.NET SDK contains a useful object model for the AsyncAPI specification in .NET along with common serializers to extract raw AsyncAPI JSON and YAML documents from the model as well.
CHANGELOG
Wiki and getting started guide
Install the NuGet packages:
Main classes to know:
- AsyncApiStringReader
- AsyncApiStringWriter
- There is an extension on the AsyncApiDocument type which allows Serializing as well (
new AsyncApiDocument().SerializeAsJson()ornew AsyncApiDocument().SerializeAsYaml()
- There is an extension on the AsyncApiDocument type which allows Serializing as well (
varmyFirstAsyncApi=newAsyncApiDocument{Info=newAsyncApiInfo{Title="my first asyncapi"},Channels=newDictionary<string,AsyncApiChannel>{{"users",newAsyncApiChannel{Subscribe=newAsyncApiOperation{OperationId="users",Description="my users channel"}}}}};varyaml=myFirstAsyncApi.SerializeAsYaml();//asyncapi: '2.5.0'// info:// title: my first asyncapi// channels:// users:// subscribe:// operationId: users// description: my users channel
varhttpClient=newHttpClient{BaseAddress=newUri("https://raw.githubusercontent.com/asyncapi/spec/"),};varstream=awaithttpClient.GetStreamAsync("master/examples/streetlights-kafka.yml");varasyncApiDocument=newAsyncApiStreamReader().Read(stream,outvardiagnostic);
To add support for reading bindings, simply add the bindings you wish to support, to theBindings collection ofAsyncApiReaderSettings.There is a nifty helper to add different types of bindings, or like in the exampleAll of them.
varsettings=newAsyncApiReaderSettings();settings.Bindings=BindingsCollection.All;varasyncApiDocument=newAsyncApiStringReader(settings).Read(stream,outvardiagnostic);
This project welcomes contributions and suggestions.Do you want to contribute to the project? Find out howhere.
About
The AsyncAPI.NET SDK contains a useful object model for AsyncAPI documents in .NET
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
