Show only selected controllers in swagger-swashbuckle UI

Subash Kharel picture Subash Kharel · Jan 20, 2017 · Viewed 11.3k times · Source

I am currently using swagger in my project and i have more than 100 controllers there. I guess due to the large number of controller, swagger UI documentation page takes more than 5 min to load its controller. Is it possible to select specific controllers at the UI page and load options for them only? Or else there are other methods to load UI page faster? Help me!

Answer

peeyush rahariya picture peeyush rahariya · Feb 13, 2017

you can use ApiExplorerSettings on either controller to ignore a controller completely or on a method.

[ApiExplorerSettings(IgnoreApi = true)]
public class MyController
{
    [ApiExplorerSettings(IgnoreApi = true)]
    public string MyMethod
    {
      ...
    }
}