You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
There is an extension on the AsyncApiDocument type which allows Serializing as well (new AsyncApiDocument().SerializeAsJson() or new AsyncApiDocument().SerializeAsYaml()
Writing
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
To add support for reading bindings, simply add the bindings you wish to support, to the Bindings collection of AsyncApiReaderSettings.
There is a nifty helper to add different types of bindings, or like in the example All of them.