Closed
Description
Current Behavior: Error messages contain indices of elements from the previous request.
Expected Behavior: Error messages should be idempotent; for two identical requests, I expect the same error message.
Parameters:
params do
requires :items, type: Array do
requires :item, type: Hash do
requires :name, type: String
end
end
end
Sequence of Requests:
Request 1: {}
Response: 'items is missing, items[item][name] is missing'
Request 2: {"items":[{"item":{"name":"foo"}},{"item":{"name":"foo"}},{}]}
Response: 'items[2][item] is missing, items[2][item][name] is missing'
Request 3: {}
Response: 'items is missing, items[2][item][name] is missing'
The response to the last request should be the same as the response to the first request.
This issue is reproducible in version 1.7.1 and in the main branch.