title: How to write @ApiResponse which may return a Class or a List of that class using OpenAPI 3 Swagger in Spring Boot
body: <p>As written in documentation we can use anyOf with @Schema if we want to define multiple responses.</p>
  <pre><code>    @ApiResponse(responseCode = &quot;201&quot;, description = &quot;OK&quot;,
          content = @Content(schema = @Schema(anyOf = {Product.class, Activity.class})))
  </code></pre>
  <p>My controller returns either a <code>Product</code> or a <code>List&lt;Product&gt;</code>. I would like to specify this in my OpenAPI 3 documentation.
  I would like to know if it's possible.
  If Yes, then how?
  If No, then is there any workaround?</p>
  <p>I don't only want to specify <code>List.class</code>. I want to specify <code>List&lt;Product&gt;</code>.</p>
  <p>P.S.:- Searching on Google didn't get me any results that I can use.</p>