title: Swagger/Openapi-Annotations: How to produce allOf with $ref?
body: <p>I'm generating Rest endpoints including adding <strong>Openapi/Swagger</strong> annotations to the generated code.</p>
  
  <p>While it works quite well with basic types, I have some problems with custom classes.</p>
  
  <p>Right now I have a lot of duplicate schema entries for the custom classes (using <em>@Schema(implementation = MyClass.class))</em> but at least the needed information is there. However I'd like to find a way to <strong>remove the duplicate schema entries while retaining the additional information</strong>.</p>
  
  <p>On a github-issue discussing the <strong>$ref</strong> and lack of <em>sibling properties</em> I found <a href="https://github.com/OAI/OpenAPI-Specification/issues/556#issuecomment-192007034" rel="noreferrer">an example</a> how you would write it manually in yaml in order to get the result I'm looking for, however I can't figure out how to set the annotations to produce it.</p>
  
  <p>This is how I <em>think</em> the annotation should look like if I follow the <a href="https://github.com/OAI/OpenAPI-Specification/issues/556#issuecomment-192007034" rel="noreferrer">example</a> (just to be on the safe side it is added to both the getter and the setter):</p>
  
  <pre><code>  import io.swagger.v3.oas.annotations.media.Schema;
  
    ...
  public class SepaPaymentRequest {
    ...
  
    @Schema(name = "w307BetrBeg", description = "BETRAG BEGUENSTIGTER ", allOf = { com.diesoftware.services.utils.Betrag.class }, required = true)
    public void setW307BetrBeg(final Betrag w307BetrBeg) {
      this.w307BetrBeg = w307BetrBeg;
    }
  
    ...
  }
  </code></pre>
  
  <p>However what I get when I fetch the openapi.yaml (snippet):</p>
  
  <pre><code>    w307BetrBeg:
        $ref: '#/components/schemas/Betrag'
  </code></pre>
  
  <p>What I'd like to have:</p>
  
  <pre><code>    w307BetrBeg:
        title: 'Betrag'
        description: 'BETRAG BEGUENSTIGTER'
        allOf:
          - $ref: '#/components/schemas/Betrag'
  </code></pre>
  
  <p>Any hints are more than welcome.</p>