How to permit an array using strong parameters?



I’m trying to permit an array in strong parameters.

What I’m trying to do is to pass form-data like this:


With Rails, it works if I permit it like this:

params.permit(items: [])

It also works well with Jets when running it with rspec. Yet, it does not when deployed on AWS.

If I do params.inspect, I am receiving:

Locally with test rspec environment:
<ActionController::Parameters {"items"=>["a"]} permitted: false>
Passing it like this:
post '/v1/some/path', params: { "items[]": 'a' }

Remotely with AWS-deployed code:
<ActionController::Parameters {"items[]"=>"a"} permitted: false>

Here’s the “body” parameter of Lambda event:
"body": "{\"items[]\": \"a\"}",

How can it be fixed? Or maybe I am doing it incorrectly?