I used NSwag to generate a client for a single controller; I needed it as its own separate client. I would like for it to be ignored when the Swagger specification is generated in the future.
I tried adding this attribute at the top of the controller but it is still being noted in the specification:
[ApiExplorerSettings(IgnoreApi = true)]
My controller is implementing the standard Microsoft.AspNetCore.Mvc.Controller
class.
I think in the latest version,
[ApiExplorerSettings(IgnoreApi = true)]
is supported.
Otherwise you can add the SwaggerIgnoreAttribute
OR OpenApiIgnoreAttribute
attribute
[SwaggerIgnore]
[OpenApiIgnore]
Or manually select the controllers in NSwagStudio or in the middleware...