How do I generate API documentation for SignalR

Here’s a Nuget package which can help you.

Nuget link: https://www.nuget.org/packages/SignalRSwaggerGen/

Github link: https://github.com/essencebit/SignalRSwaggerGen/wiki

First you need to decorate your SignalR hubs with attributes from SignalRSwaggerGen.Attributes namespace:

[SignalRHub]
public class SomeHub : Hub
{
}

Then you add SignalRSwaggerGen to Swagger generator:

services.AddSwaggerGen(options =>
{
    options.SwaggerDoc("v1", new OpenApiInfo { Title = "Some API v1", Version = "v1" });
    // here some other configurations maybe...
    options.AddSignalRSwaggerGen();
});

For more information please refer to Github documentation.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)