To clarify what Boti said, I think he meant that he changed the type of the array to a string and sent the string of the JSON array - the value "[1,2,3]" . Obviously this is not ideal, but it will work if you parse it on the API side. So the parameters will be -
params do requires :ids, type: String, desc: 'Array of group ids' end
To be clear, this is a problem with the Swagger screech user interface, especially because Grape Swagger supports Swagger 1.2. Grape Swagger has a problem sending the correct format for the Swagger array (see this Github question ). Grape does an excellent job of array type, you just cannot test it in Swagger-UI.
For our project, we simply did not use Swagger for this parameter. I would prefer the test platform (Swagger-UI) to work incorrectly than to edit otherwise the correct code in the actual product.
source share