Title: Tell Swashbuckle to only look for controllers that have the ApiControllerAttribute
Tags: c#;asp.net-core;.net-core;asp.net-core-mvc;swashbuckle
Question: I'm working on a Web MVC project and inside it I want to have some api controllers for external apps to use.

My API controllers have the ```ApiController``` attribute on them.

Unfortunately, Swashbuckle picks up ALL the controllers/actions.
Is there a way to tell it to only look for Api controllers?

Thank you.

Comment: Do you deveop with asp.net core mvc or asp.net mvc? If it is asp.net core, what is .net core version and `Swashbuckle.AspNetCore` version? I made a test with asp.net core 2.2 and `Swashbuckle.AspNetCore` 4.0.1, it will only generate the method for `ApiController`. In addition, you may try to refer https://github.com/domaindrivendev/Swashbuckle/issues/153#issuecomment-213342771


Here is another answer: You can put this in the controller you want to hide from Swashbuckle

```[ApiExplorerSettings(IgnoreApi = true)]
public class UserController : Controller
```

Comment for this answer: Maybe you can create your own `BaseController` which inherits from  `Controller` and in it put the `[ApiExplorerSettings(IgnoreApi = true)]`, and then replace the `Controller` in your controllers that you want to be ignored with the new `BaseController`.
Comment for this answer: It's a valid solution but I'll have to put that in all my controllers, which is a bit too tiring...

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2019:00:05/30/19', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c#><asp.net-core><.net-core><asp.net-core-mvc><swashbuckle>', 'Title': 'Tell Swashbuckle to only look for controllers that have the ApiControllerAttribute', 'ViewCount': 121, 'id': 56377359, 'user_AboutMe': '<p>A young, passionate developer craving knowledge.</p>\n', 'user_AccountId': 7123240.0, 'user_DisplayName': 'Haytam', 'user_Reputation': 4565.0, 'user_Views': 619.0, 'user_id': 5447084.0}}