Skip to content

Instantly share code, notes, and snippets.

@VisualBean
Last active April 7, 2023 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VisualBean/1981fa98d5bd3a0ba8d5be82b9bd4a5a to your computer and use it in GitHub Desktop.
Save VisualBean/1981fa98d5bd3a0ba8d5be82b9bd4a5a to your computer and use it in GitHub Desktop.
using LEGO.AsyncAPI.Readers;
// Read the file into a stream
using var filestream = new FileStream("user.yml", FileMode.Open);
// Create a new AsyncAPI Stream reader and deserialize the file
var document = new AsyncApiStreamReader().Read(filestream, out var diagnostic);
foreach (var channel in document.Channels)
{
// Write out any channel keys
Console.WriteLine(channel.Key);
}
// Outputs "user/signedup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment