title: Swagger configured in Spring Boot shows only methods with POST and GET mapping
body: <p>Swagger configured in Spring Boot shows only one method with <em>POST</em> mapping and one method with <em>GET</em> mapping from every controller. Swagger ignores another methods with <em>GET</em> and <em>POST</em> mapping and ignores all methods with <em>PUT</em> and <em>DELETE</em> mappings. My configuration:</p>
  
  <pre><code>@Configuration
  @EnableSwagger2
  public class SwaggerConfig {
  
      @Bean
      public Docket api(){
          return new Docket(DocumentationType.SWAGGER_2)
                  .select()
                  .apis(RequestHandlerSelectors.basePackage("my.project.controllers"))
                  .paths(PathSelectors.ant("/api/*"))
                  .build();
      }
  }
  </code></pre>
  
  <p>Dependency in pom.xml:</p>
  
  <pre><code>        &lt;dependency&gt;
              &lt;groupId&gt;io.springfox&lt;/groupId&gt;
              &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
              &lt;version&gt;2.7.0&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.springfox&lt;/groupId&gt;
              &lt;artifactId&gt;springfox-swagger-ui&lt;/artifactId&gt;
              &lt;version&gt;2.7.0&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>My controllers code:</p>
  
  <p>@RestController
  @RequestMapping(value = "/api/users", produces = "application/json; charset=UTF-8")
  public class UserController {</p>
  
  <pre><code>@Autowired
  private UserService userService;
  
  protected UserService getService() {
      return userService;
  }
  
  @RequestMapping(method = GET)
  public Page&lt;User&gt; query(@RequestParam Map&lt;String, Object&gt; parameters, Pageable pageable) {
      return getService().query(parameters, pageable);
  }
  
  @ResponseStatus(CREATED)
  @RequestMapping(method = RequestMethod.POST)
  public ResponseEntity&lt;User&gt; create(@RequestBody User entity) {
      return ResponseEntity.status(HttpStatus.CREATED).body(getService().create(entity));
  }
  
  @RequestMapping(value = "/{id:[0-9]+}", method = RequestMethod.PUT)
  public ResponseEntity&lt;User&gt; update(@PathVariable Long id, @RequestBody User entity) {
      return ResponseEntity.ok(getService().update(id, entity));
  }
  
  @RequestMapping("/current")
  public ResponseEntity current() {
      return ResponseEntity.ok(userService.getUser());
  }
  
  @ResponseStatus(HttpStatus.OK)
  @RequestMapping(value = "/{id:[0-9]+}/enable", method = RequestMethod.POST)
  public void enable(@PathVariable("id") final long id) {
      userService.enable(id);
  }
  
  @ResponseStatus(HttpStatus.OK)
  @RequestMapping(value = "/{id:[0-9]+}/disable", method = RequestMethod.POST)
  public void disable(@PathVariable("id") final long id) {
      userService.disable(id);
  }
  
  @RequestMapping(value = "/histories", method = RequestMethod.GET)
  public List&lt;UserHistory&gt; histories() {
      return userService.histories();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>May be i need add some more configuration or add something else?</p>