Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 1014 Bytes

File metadata and controls

13 lines (9 loc) · 1014 Bytes

SignalRSwaggerGen Attribute Example

Small example of using the SignalRSwaggerGen attributes for methods. Since I have little experience with attributes in general and there is little documentation on SignalRSwaggerGen, using these attributes led to a some headaches. I hope this helps someone.

Background

For a .NET project utilizing SignalR, some of the SignalR endpoints/methods were integrated into the Swagger documentation of the API, using the SignalRSwaggerGen library by @essencebit and the attributes it provides.

My problem

When I tried to use SignalRReturn and SignalRParam, I got error CS0592, but I had a hard time understanding what I had done wrong when applying the attributes.

Solution

See the code snippet.

I hope this saves someone some time and helps to understand attributes better!