0

ASP.NEt Core 3.1 I would like to suppress one certain controller. Therefore i tried use the DocumentProcessor, but without success.

public class DocumentProcessor : IDocumentProcessor

I have no access to this specific controller. So i need a solution like ist was possible before. It was possible in ASP.NET MVC by "filtering" the controllers.

old code:

var controllers = new[] { typeof(ExternalApiController)
                                        , typeof(ExternalApiDatasourceController)                                        
                                    };

var document = Task.Run(async () => await generator.GenerateForControllersAsync(controllers)).GetAwaiter().GetResult();
ahorak
  • 123
  • 8

1 Answers1

0

I think the best option is to implement and register a custom operation process and exclude all operations of this controller (return false): https://github.com/RicoSuter/NSwag/wiki/Document-Processors-and-Operation-Processors#operation-processors

Rico Suter
  • 11,548
  • 6
  • 67
  • 93