swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

Isn't "type: file" supposed to be allowed in a Response Object?

Open tsz662 opened this issue 11 years ago • 2 comments

Swagger Editor complains the following Swagger Spec is not valid because of type is file in the 200 response object (the error goes away if file is changed to something like string). But according to Response Object - Fixed Fields, it is supposed to be valid:

As an extension to the Schema Object, its root type value may also be file.

Or am I missing something here?

"/files/images/{id}" : {
      "get" : {
        "summary" : "Returns the specified image.",
        "produces" : [ "image/jpeg" ],
        "parameters" : [ {
          "name" : "id",
          "in" : "path",
          "description" : "Id of the image to get.",
          "required" : true,
          "type" : "string"
        } ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "schema" : {
              "type" : "file"
            }
          },

tsz662 avatar Jun 08 '15 23:06 tsz662

That's on me, unfortunately. Please follow https://github.com/swagger-api/swagger-spec/issues/260.

webron avatar Jun 08 '15 23:06 webron

Thank you for the response. I will follow that issue and close this one.

tsz662 avatar Jun 09 '15 00:06 tsz662