Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 18
Home
Alex Wichmann edited this page Feb 23, 2023
·
3 revisions
The AsyncAPI.NET library is a document object model (DOM) for an AsyncAPI description document. It provides a set of classes for constructing semantically valid AsyncAPI specifications. The library also includes a writer for serializing the DOM into JSON or YAML AsyncAPI specifications
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.6.0'// info:// title: my first asyncapi// channels:// users:// subscribe:// operationId: users// description: my users channelvarhttpClient=newHttpClient{BaseAddress=newUri("https://raw.githubusercontent.com/asyncapi/spec/"),};varstream=awaithttpClient.GetStreamAsync("master/examples/streetlights-kafka.yml");varasyncApiDocument=newAsyncApiStreamReader().Read(stream,outvardiagnostic);You can read more about more advanced ways to of reading or writing in the Wiki