Closed
Description
I wrote the following code.
params do
requires :items, type: Array[JSON] do
requires :id, type: Integer
requires :enabled, type: Boolean
end
end
post '/' do
# ...
A request with following params succeeds
{ items: [{ id: 1, enabled: true }, { id: 2, enabled: false }] }
But fails with following.
{ items: [] }
I changed the code to
params do
optional :items, type: Array[JSON] do
But, all requests failed then.
I want to allow { items: [] }
params. Is there any way to do it?
Thanks.
Metadata
Metadata
Assignees
Labels
No labels