[dry-schema] errors message handling

Hello,

I am working with dry-schema, I run the validation process for the nested attribute, and I try to deal with errors messages.

so after result.errors.to_h I have:

{:specification=>
  #<Dry::Schema::Result{:specification=>[{:title=>111, :id=>123, :items=>[{:pos=>"1", :title=>"Chapter 1"}]}]} errors={:specification=>{0=>{:title=>["must be a string"], :id=>["must be a string"]}}}>}

But when I try to run like subject.errors.messages[:specification][0].errors to get the errors messages, it changed to

#<Dry::Schema::MessageSet messages=[#<Dry::Schema::Message text="must be a string" path=[:specification, 0, :title] predicate=:str? input=111>, #<Dry::Schema::Message text="must be a string" path=[:specification, 0, :id] predicate=:str? input=123>] options={:failures=>true}>

which is Dry::Schema::MessageSet class.`

Why the errors messages changed to something else, so the error message is now harder to understand? Do I miss anything?

This could be a bug. Could you provide a full reproduction script? Coercing a message set to a hash is supposed to coerce it deeply, so the resulting hash should not include any nested result objects.

Hi, it appeared that I combine dry-validation with Active Model validations, so that was the issue.