request.deep_munge requires a Hash to be passed to it, and the params_parser already wraps non-Hash objects, so it makes sense to just call deep_munge after wrapping the non-Hash object.
Looks good. We'll need a CHANGELOG entry and a backport to 3-2-stable as well. Thanks!
Fix JSON params parsing regression for non-object JSON content.
@jeremy added changelog and backport to 3-2-stable.
Thanks @dylanahsmith. Last thing: could you squash to a single commit and force-push? Clean git history 👍
Fix json params parsing regression for non-object JSON content.
I think you need to add
request.body.rewind if request.body.respond_to?(:rewind)
since ActiveSupport::JSON.decode is going to call request.body.read (at least when using unicorn). If you do not, accessing request.body.read from a controller action will return an empty string.