ruby-grape / ruby-grape/grape-swagger
Cannot post Array params
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.1k
- Forks
- 479
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 6
Description
params do
...
optional :user_profiles, type: Array, default: [] do
requires :value, type: String, desc: "Value of the user profile"
end
end
Using the above gives me curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d 'user_profiles[value]=1' 'http://localhost:3000/api/v1/accounts/3/users', and it rejects with user_profiles invalid.
Can someone tell me what am I doing wrong here? Thx!
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
No source file or test is identified. Start by reproducing the documented POST with the shown Grape params and compare the generated form encoding with the request Grape accepts; done means array parameters are documented with an accepted request format and covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100