Wrong error message when use hash of array of hashes
dluhhbiu opened this issue · 0 comments
dluhhbiu commented
Hello. I realized when use hash of array of hash then got wrong error message
class TestArrayOfHashes < ActiveInteraction::Base
hash :data do
array :test do
hash do
string :value
string :value2
end
end
end
def execute
inputs
end
end
When I run next code, I get correct response
# code
TestArrayOfHashes.run!(data: { test: [{ value: 'foo', value2: 'bar' }] })
# response
{:data=>{"test"=>[{"value"=>"foo", "value2"=>"bar"}]}}
But next part of code works incorrect like my opinion
# code
TestArrayOfHashes.run!(data: { test: [{ value: 'foo', wrong_value: 'foo' }] })
# response
Data test required (ActiveInteraction::InvalidInteractionError)
Error is correct, but I expected something like Data test value2 required
Is it bug or correct behavior?
Version of gem active_interaction (5.3.0)