Swashbuckle.webapi: Is there a way to exclude a controller?

Created on 8 Dec 2014  路  4Comments  路  Source: domaindrivendev/Swashbuckle.WebApi

Is there a way to exclude an API controller? I don't want to show this controller because i'm still working on it.

I've added the obsolete method on each action but I find it it repetitive. Is there a configuration, annotation, or better way to exclude controllers not ready for documentation?

Most helpful comment

Swashbuckle is built on top of IApiExplorer and so you can use the following attribute to ignore an entire controller:

[ApiExplorerSettings(IgnoreApi = true)]
public class MySpecialController : ApiController
{

All 4 comments

Swashbuckle is built on top of IApiExplorer and so you can use the following attribute to ignore an entire controller:

[ApiExplorerSettings(IgnoreApi = true)]
public class MySpecialController : ApiController
{

Is it possible to dynamically change the visibility of controllers within Swashbuckle, based upon a url?

For example
/internal/swagger
might show internal/diagnostic endpoints that a public
/swagger
might not?

Just an idea. Thanks so much for this project!

@mattlpage probably too late for you but adding here for reference:
The [ApiExplorerSettings] attribute is allowed at Controller as well as Action method level. So effectively, one can exclude a single endpoint/route from a controller

please, make settings to ignore all API but only has [SwaggerInclude] attribute or something

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kongres picture kongres  路  4Comments

qwertykeith picture qwertykeith  路  5Comments

niemyjski picture niemyjski  路  3Comments

whippet-rider picture whippet-rider  路  5Comments

DotNetRockStar picture DotNetRockStar  路  3Comments