title: How to specify a generic type class for Swagger API response
body: <p>I have about 40 APIs that have similar base response structure as follows:</p>
  
  <pre><code>{
      "lastAccessed": "2015-30-08:14:21:45T",
      "createdOn": "2015-30-07:09:04:10T",
      "lastModified": "2015-30-08:14:21:45T",
      "isReadOnly": "false",
      "usersAllowed" : ["Tim", "Matt", "Christine"];
      "noOfEntries": 1,
      "object": [
          "ObjectA": {
               //here object A has its own model
           }
      ]
  }
  </code></pre>
  
  <p>So I have a base response class taking a generic of type T as follows:</p>
  
  <pre><code>public class Response&lt;T&gt; {
      @ApiModelProperty(value="Last time accessed")
      private String lastAccessed;
      @ApiModelProperty(value="Time when Created ")
      private String createdOn;
      private String lastModified;
      @ApiModelProperty(value="Created on")
      private boolean isReadOnly;
      @ApiModelProperty(value="Users that has access to the object.")
      private List&lt;String&gt; usersAllowed;
      private int noOfEntries;
      private T object;
  
      //getters and setters
  }
  </code></pre>
  
  <p>So for the API A, which returns the Object of type  with its own fields, I am returning Response as the API response in the controller:</p>
  
  <pre><code>  public class A {
      @ApiModelProperty(value="Name")
      private String name;
      @ApiModelProperty(value="OID")
      private String id;    
      //getters and setters
  }    
  </code></pre>
  
  <p>In the controller:
      Response data = new Response();
      ResponseEntity response = new ResponseEntity&lt;>(data, HttpStatus.OK); </p>
  
  <p>Is there a way in swagger I can specify the model of the response object recursively? For example, I could have the annotation @ApiOperation(response=Response.class) but that would not have the model for A. </p>