Tool for generating documentation of domain events. Inludes a simple UI to depict what specified events, commands are used in specific service.
This library is inspired by Swagger
. Project is still evolving.
- Instal Nuget package into your ASP.NET Core application.
dotnet add package Kros.BusEventDoc
- In the ConfigureServices method of
Startup.cs
, register the BusEventDoc generator, defining BusEventDoc document.
using Kros.EventBusDoc.Generator.Middleware.Extensions;
services.AddEventBusDocGen(c =>
c.EventBusDoc("v1", new Info { Version = "v1", Title = "Demo" })
);
- In the Configure method, attach to the pipeline BusEventDoc generator. Generator produces json.
app.UseEventBusDoc();
- For generation and exploring definitions and types use BusEventDoc attribute annotation to specify the subjects.
We recommend use this annotation in the
AssemblyInfo.cs
.
using Kros.EventBusDoc.Generator.BusentAnnotation;
[assembly: BusEvent(EventType =typeof(ISendEvent) )]
[assembly: EventBusCommandConsumer(EventType =typeof(IConsumeOne) )]
[assembly: EventBusCommandSender(EventType =typeof(ISendCommand) )]
- To visual json document generated by BusEventDoc generator insert BusEventDoc UI middleware, with specific endpoint(s).
dotnet add package Kros.BusEventDoc.UI
app.UseEventBusDocUI(c => { c.EventBusDocEndPoint("v1/busent.json", "Demo"); });
- If the BusEventDoc is configured we can call for output "/busent".
You can see simple example DEMO