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

Array params are always sent as `formData` on GET requests

Open newstler opened this issue 4 years ago • 3 comments

Hello, and thank you for such an amazing piece of software.

I'm not sure how it was planned to be, but I've noticed that array params are always been sent as formData, even on GET requests. However, any other than query params are not usually accepted when sending the GET requests.

Yep, it's possible to set param_type through documentation: {}, but that's not always comfortable to do.

Here's my little fix: https://github.com/newstler/grape-swagger/pull/1/commits/f66655462ba7140a113338c0021076bbb330e810

newstler avatar May 07 '20 07:05 newstler

please add a spec to your fix and open a PR

LeFnord avatar Sep 02 '20 21:09 LeFnord

Same for me

fullc0ntr0l avatar Oct 22 '21 14:10 fullc0ntr0l

Actually you can use param_type option:

optional :ids, type: [Integer], default: [], documentation: { param_type: 'query' }

fullc0ntr0l avatar Oct 22 '21 14:10 fullc0ntr0l