support Array with index#1261
Conversation
There was a problem hiding this comment.
return false unless hash.present?
|
I like this. It needs to be documented in README, updated in CHANGELOG, commits squashed, please. |
| * [#1252](https://github.com/ruby-grape/grape/pull/1252): Allow default to be a subset or equal to allowed values without raising IncompatibleOptionValues - [@jeradphelps](https://github.com/jeradphelps). | ||
| * [#1255](https://github.com/ruby-grape/grape/pull/1255): Allow param type definition in `route_param` - [@namusyaka](https://github.com/namusyaka). | ||
| * [#1257](https://github.com/ruby-grape/grape/pull/1257): Allow Proc, Symbol or String in `rescue_from with: ...` - [@namusyaka](https://github.com/namusyaka). | ||
| * [#1261](https://github.com/ruby-grape/grape/pull/1261): support array with index - [@itoufo](https://github.com/itoufo). |
|
I missed this PR, Github doesn't notify on force push. Can you please rebase it, make sure it passes and what not. I'll re-read the code now. Tack a comment here. |
| end | ||
| ``` | ||
|
|
||
| If type is Array, It support following kinds of parameter. |
There was a problem hiding this comment.
We never use curl in examples here, I don't think it's a good idea to introduce it. It's also fairly confusing TBH given that you POST to a JSON API, but don't actually send JSON data. I would explain this in Ruby, keeping it more like "documentation" and less like "example"?
|
@dblock Can we get this branch updated and merged in? I'm running into this very issue where JQuery Ajax POSTs arrays with nested objects as hashes 0-based keys.. 😒 |
|
Please see my comments above and feel free to finish the PR @dja. |
This change will enable to use array with index.