title: Swagger defination, how to specify that a file is returned?
body: <p>I want to download a file from the server, and I define the swagger file as follows:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>swagger: '2.0'
  
  ################################################################################
  # API Information
  ################################################################################
  info:
    version: v0
    title: XXX REST API
  
  host: api.xxx.io
  basePath: /v0
  
  schemes:
    - http
    - https
  produces:
    - application/json
  
  ################################################################################
  # Security
  ################################################################################
  
  
  ################################################################################
  # Parameters
  ################################################################################
  parameters:
    productId:
      name: productId
      in: path
      description: The product identifier
      type: string
      required: true
  
  ################################################################################
  # Paths
  ################################################################################
  paths:
    /products:
      get:
        description: Get the list of products
        operationId: getProducts
        responses:
          200:
            description: OK
            schema:
              type: array
              items:
                $ref: '#/definitions/Product'
  
    /resources/{productId}:
      parameters:
        - $ref: '#/parameters/productId'
      get:
        description: Get resources of a product
        operationId: getResourcesByProductId
        produces:
          - application/octet-stream
        responses:
          200:
            description: OK
            schema:
              type: file
  
  ################################################################################
  # Definitions
  ################################################################################
  definitions:
    Product:
      type: object
      required:
        - id
      properties:
        id:
          type: string
        name:
          type: string
        category:
          type: array
          items:
            type: string
        description:
          type: string
        price:
          type: number
        thumbnailUri:
          type: string
        previewUris:
          type: array
          items:
            type: string
        resources:
          type: array
          items:
            $ref: '#ResourceMeta'</code></pre>
  </div>
  </div>
  </p>
  
  <p>And the api is as follows:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringCodegen", date = "2016-10-24T17:56:03.446+08:00")
  
  @Controller
  public class ResourcesApiController implements ResourcesApi {
  
      public ResponseEntity&lt;File&gt; getResourcesByProductId(
  @ApiParam(value = "The product identifier",required=true ) @PathVariable("productId") String productId
  
  
  ) {
          // do some magic!
          return new ResponseEntity&lt;File&gt;(HttpStatus.OK);
      }
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>My controller is as follows:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>@Controller
  public class ResourceController implements ResourcesApi {
  
      private final Logger logger = Logger.getLogger(ResourceController.class);
  
  //    @RequestMapping(value="/resources/{productId}", method= RequestMethod.GET)
      public ResponseEntity&lt;File&gt; getResourcesByProductId(@ApiParam(value = "The product identifier", required = true) @PathVariable("productId") String productId) {
          String path = "resources" + File.separator + productId;
          File file = new File(path);
          FileSystemResource fileSystemResource = new FileSystemResource(file);
          InputStreamResource inputStreamResource = null;
          try {
              inputStreamResource = new InputStreamResource(fileSystemResource.getInputStream());
          } catch (IOException e) {
              logger.error(e.toString());
          }
  
          HttpHeaders headers = new HttpHeaders();
          headers.add("Content-Disposition", String.format("attachment; filename=\"%s\"", file.getName()));
  
          return ResponseEntity
                  .ok()
                  .headers(headers)
                  .contentLength(file.length())
                  .body(file);
      }
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>However, when I run the application, it return a file but only contains the metadata of the file instead of its content. How can I make it return the file content? Thanks！</p>