Closed
Description
Given a request like:
{ "orders": [ {customerId: 'invalid', salesPersonId: 5}, {customerId: 5, salesPersonId: 'invalid'} ] }
And the following parameter definitions:
params do
requires :orders, type: Array do
requires :customerId, type: Integer
requires :salesPersonId, type: Integer
end
end
Grape correctly detects that the input is invalid. However there is no context in the errors collection about which item in the array was invalid. Currently the error is reported against the key orders[customerId]
but I need to be able to pair the errors back to the original element in the array like orders[0][customerId]
.
Is this supported by grape?