title: Generating OpenAPI documentation using springdoc-openapi with spring-boot-starter-data-mongodb
body: <p>I've started a new Spring Boot app (2.2.1.RELEASE) using MongoDB.</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-starter-data-mongodb&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-starter-data-rest&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>To have some API documentation created I added springdoc-api:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;dependency&gt;
    &lt;groupId&gt;org.springdoc&lt;/groupId&gt;
    &lt;artifactId&gt;springdoc-openapi-ui&lt;/artifactId&gt;
    &lt;version&gt;1.1.49&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>As I am relying on Spring to take care of the generation of the REST endpoint, I created this simple repository:</p>
  <pre class="lang-java prettyprint-override"><code>@RepositoryRestResource(collectionResourceRel = &quot;profile&quot;, path = &quot;profile&quot;)
  public interface ProfileRepository extends MongoRepository&lt;Profile, String&gt; {
  
    List&lt;Profile&gt; findByLastname(@Param(&quot;n&quot;) String lastname);
    List&lt;Profile&gt; findByFirstname(@Param(&quot;n&quot;) String firstname);
    List&lt;Profile&gt; findByEmail(@Param(&quot;e&quot;) String email);
  
  }
  </code></pre>
  <p>So I have no class with <code>@RestController</code>.</p>
  <p>I tried to add some <code>io.swagger.v3.oas.annotations</code> annotations to the methods in <code>ProfileRepository</code>, but nothing gets generated.</p>
  <pre class="lang-java prettyprint-override"><code>@Operation(summary = &quot;Find Profile by first name&quot;, description = &quot;Find Profile by first name&quot;)
  List&lt;Profile&gt; findByLastname(@Param(&quot;n&quot;) String lastname);
  </code></pre>
  <p>Result of <code>http://localhost:8080/v3/api-docs/</code>:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;openapi&quot;: &quot;3.0.1&quot;,
    &quot;info&quot;: {
      &quot;title&quot;: &quot;OpenAPI definition&quot;,
      &quot;version&quot;: &quot;v0&quot;
    },
    &quot;servers&quot;: [
      {
        &quot;url&quot;: &quot;http://localhost:8080&quot;,
        &quot;description&quot;: &quot;Generated server url&quot;
      }
    ],
    &quot;paths&quot;: {},
    &quot;components&quot;: {}
  }
  </code></pre>
  <p>How can I have the API documentation generated for my Spring Data REST repository endpoints?</p>