wkennedy / swagger4spring-web

Swagger support for Spring MVC
89 stars 46 forks source link

RFE: ApiDocumentationController should have a mechanism to exclude classes, packages and/or methods #95

Open mrtoadsc opened 8 years ago

mrtoadsc commented 8 years ago

There should be a mechanism to exclude a class or method from the /resourceList construction on a @Controller that had been loaded from the ApiDocumentationController.

Currently, the ApiDocumentationController will process all the @Controllers with @RequestMapping and there is a mechanism for excluding custom annotations (setIgnorableAnnotations()). This may not be easy to do when there is a 3rd party library where we would to generate Swagger for some controllers but exclude others.

The 'Filter' interface provide a mechanism to include/exclude specific methods but these filters are only used if there are no request mappings.

One possible solution could be to honor the same @ComponentScan/excludeFilters that Spring @Configuration uses.