swagger-editor
swagger-editor copied to clipboard
Isn't "type: file" supposed to be allowed in a Response Object?
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"
}
},
That's on me, unfortunately. Please follow https://github.com/swagger-api/swagger-spec/issues/260.
Thank you for the response. I will follow that issue and close this one.