title: Configuring Swagger for Multiple Controller in Spring boot microservice
body: <p>I am trying to add ReST API docs using Swagger in my microservice which is developing using spring boot. I added properly for one controller. But when I added for two controller. It is not getting listing in swagger-ui.html.</p>
  
  <p>Let me add my findings here,</p>
  
  <p>My swagger config file</p>
  
  <pre><code>@EnableSwagger2
  @PropertySource("classpath:swagger.properties")
  @ComponentScan(basePackageClasses = { 
    WebController.class,TestController.class})
  @Configuration
  
  public class SwaggerConfig {
  
      private static final String SWAGGER_API_VERSION = "1.0";
      private static final String LICENSE_TEXT = "License";
      private static final String title = "Spacestudy Framework REST API";
      private static final String description = "docs for test Framework";
  
      private ApiInfo apiInfo() {
          return new ApiInfoBuilder()
                  .title(title)
                  .description(description)
                  .license(LICENSE_TEXT)
                  .version(SWAGGER_API_VERSION)
                  .build();
      }
  
      @Bean
      public Docket frameworkApi() {
          return new Docket(DocumentationType.SWAGGER_2)
                  .apiInfo(apiInfo())
                  .pathMapping("/")
                  .select()
                  .paths(PathSelectors.regex("/api.*"))
                  .build();
      }
   }
  </code></pre>
  
  <p>My first controller file is ,</p>
  
  <pre><code>@RestController
  @RequestMapping("api/${urlLink}")
  @Api(value = "WebControllerAPI", produces = 
   MediaType.APPLICATION_JSON_VALUE)
  
  public class WebController {
  
  @PutMapping("/loadMessage/{message}")
  @ApiOperation("Insert test Srting ")
  @ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = 
    WebController.class)})
  public String insertMessage(@PathVariable("message") String message) {
      return message;
   }
  }
  </code></pre>
  
  <p>My second controller file is,</p>
  
  <pre><code> @RequestMapping("api/${urlLink}")
   @Api(value = "TestControllerAPI", produces = 
    MediaType.APPLICATION_JSON_VALUE)
  public class TestController {
  
    @PutMapping("/loadMessage/{message}")
    @ApiOperation("Insert test Srting ")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = 
      WebController.class)})
     public String insertMessage(@PathVariable("message") String message) {
      return message;
      }
  }
  </code></pre>
  
  <p>And I am only getting WebController API doc from Swagger ui. I am not getting TestController End point doc.</p>
  
  <p>I am adding here screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/bXus1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bXus1.png" alt="enter image description here"></a></p>