ebowman / api-first-hand

API-First bootstrapping tool for building RESTful web services from a Swagger/OpenAPI spec
MIT License
142 stars 22 forks source link

Failure to parse a response with type: file #89

Open ajtucker opened 6 years ago

ajtucker commented 6 years ago

I'm trying to return an image as one of the paths in my Swagger API and so following the specs have used a response along the lines of:

  responses:
    200:
      description: Successfully retrieved image
      schema:
        type: file

However, the Swagger parser raises an exception:

com.fasterxml.jackson.core.JsonParseException: None.get (through reference chain: de.zalando.swagger.Schema["type"]) through reference chain: paths → /rps/{id}/image → get → responses → 200 → schema

Is there any other way to return binary data with a given mime-type?