Using Swashbuckle for Asp.net core how can I add a model to the generated model list?
I'm using Swashbuckle with ASP.net core. It is producing a nice website with a list of models at the bottom. How can I add a model to this list that isn't already appearing? I return an abstract class in one of my requests and I want to list all the variations that inherit that abstract class. Thanks in advance You could create an document filter and register it globally. public class CustomModelDocumentFilter<T> : IDocumentFilter where T : class { public void Apply(SwaggerDocument swaggerDoc, DocumentFilterContext context) { context.SchemaRegistry.GetOrRegister(typeof(T)); } } and then