I have some additional DTO classes that I need to be able to use from TypeScript, but have no use in a controller action. They'll be sent/received using a different mechanism (SignalR). I still want to use Swagger to describe the types, because I can then use Swagger CodeGen to produce TypeScript definitions.
Can I get Swashbuckle to include arbitrary DTOs, which are not a parameter or result of an action, in the Swagger docs?
Yes you can, use an IDocumentFilter
That class needs to be added in the SwaggerConfig section EnableSwagger like this:
c.DocumentFilter<ApplyDocumentVendorExtensions>();
I have a few examples here: https://github.com/heldersepu/SwashbuckleTest/blob/master/Swagger_Test/App_Start/SwaggerConfig.cs