title: Spring Data Rest, SpringFox and JpaRepository custom finders
body: <p>NB: using Spring Boot 1.4.2 + SpringFox 2.6.0</p>
  
  <p>Hi, I'm having an issue with Swagger 2 forms on my API documentation over a @RepositoryRestResource. The code below works fine (REST access OK):</p>
  
  <pre><code>@RepositoryRestResource(collectionResourceRel = "people", path = "people")
  public interface PersonRepository extends JpaRepository&lt;Person, Long&gt; {
      Person findByLastName(@Param("name") String name);
  }
  </code></pre>
  
  <p>And the HATEOAS links are right too: calling URL /api/people/search
  ends up with this (notice parameter "name"):</p>
  
  <pre><code>{
    "_links": {
      "findByLastName": {
        "href": "http://localhost:8080/api/people/search/findByLastName{?name}",
        "templated": true
      },
      "self": {
        "href": "http://localhost:8080/api/people/search"
      }
    }
  }
  </code></pre>
  
  <p>The REST API is ok: URL /api/people/search/findByLastName?name=foobar returns data when executed with a browser</p>
  
  <p>BUT in Swagger the GET <strong>parameter type</strong> is interpreted as "body" instead of "query" and the form submission (curl ... -d 'foobar'...) fails in 404, attempting to submit "name" as request body.
  So I tried to set Swagger explicitly, like this:</p>
  
  <pre><code>@RepositoryRestResource(collectionResourceRel = "people", path = "people")
  public interface PersonRepository extends JpaRepository&lt;Person, Long&gt; {
      @ApiOperation("Find somebody by it's last name")
      @ApiImplicitParams({
          @ApiImplicitParam(name = "name", paramType = "query")
      })
      Person findByLastName(@Param("name") @ApiParam(name = "name") String name);
  }
  </code></pre>
  
  <p>without any success, despite the fact that "name" is well retained in the form as the parameter name in this example :-(</p>
  
  <p><a href="https://i.stack.imgur.com/jfphq.png" rel="nofollow noreferrer">body parameter type on GET query</a></p>
  
  <p>Does anyone know what could be done to make that Swagger form to work? Thx for your help</p>