0

I'm using swagger blocks with rails. I one of the enpoint I have an image upload.

        parameter name: :tile_background_img,
                  in: :formData,
                  type: :file,
                  description: 'Tile background image'

On the swagger site it looks ok. If I add this image request has a header Content-Type: multipart/form-data; boundary=----WebKitFormBoundarybl70oGERlw1hSmnH and everything is fine. When I use other params and leave image blank I got EOFError Bad request content body the header is Content-Type: text/html According to this answer https://stackoverflow.com/a/37932354 I should add consumes. However in the docs this option is only in the general api settings and it's not working for me https://github.com/fotinakis/swagger-blocks.

Jaro
  • 860
  • 9
  • 21

1 Answers1

0

It turned out that I had to add in: :formData for other params in the request.

Jaro
  • 860
  • 9
  • 21