ruby-grape / ruby-grape/grape-swagger
Array of Entities
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.1k
- Forks
- 479
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 6
Description
Hi,
Could you please tell me if there is a way to accept the array of entities in the params with content/type application json
Example

code
params do
optional :requests, type: API::V1::Entities::Body, desc: '...'
end
But I would like to have array of requests as below
{ "requests": [ { "method": "string", "path": "string" }, { "method": "string", "path": "string" } ] }
Also tried using param_type: 'body' and is_array: true
params do
optional :requests, type: API::V1::Entities::Body, documentation: { is_array: true, param_type: 'body'}, desc: '...'
end
It ignores the outer hash when sending the application/json

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the params block and the application/json handling described in the issue, then reproduce the documented request shape with an array of requests. Trace how the outer hash and entity type are represented, and consider the work done when the generated API documentation and request handling both preserve the requested structure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100