title: How to give Generic return type in swagger yaml for Swagger dode generation?
body: <p>I have to return GetPaymentRepsonse and AuthenticationException if it failed for the same rest method generated through swaggercodegen. </p>
  
  <p>I have a solution like </p>
  
  <pre><code>default ResponseEntity&lt;?&gt; getPayment(String id,
        String agent,
        String contact,
        String token) {
  
      return new ResponseEntity&lt;PaymentResponse&gt;(HttpStatus.OK);
    }
  </code></pre>
  
  <pre><code>@Override public ResponseEntity&lt;?&gt; getPayment(String id, String agent, String contact, String token) {
  
      try {
            ........
             ..........
           return paymentReposne;
        } else {
          throw new AuthenticationException(Enum.SomeException);
        }
  
      } catch (AuthenticationException | IOException | TokenServiceException e) {
        return UtilClass.someCustomAuthenticationException(e);
      }
    }
  </code></pre>
  
  <p>swagger design</p>
  
  <pre><code>/v2.0/.../.../....:
      get:
        operationId: getPayment
        tags:
          - something
        description:
          xxx xxx xxx xxxx 
        parameters:
          - $ref: "#/parameters/token"
          - $ref: "#/parameters/id"
          - $ref: "#/parameters/agent"
          - $ref: "#/parameters/contact"
  
        responses:
          '200':
            description: 'Successful response'
            schema:
              type: object ---&gt;Here i want to give Generic type or ? to support my above code on swagger code generation
          '400':
            description:  'Bad request parameters'
  </code></pre>