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?