OfferInputsSchema = Dry::Schema.Params do
required(:inputs).array(:hash) do
required(:id).filled(:string)
required(:items).array(:hash) do
required(:pos).filled(:string)
required(:inputs).filled(:hash)
end
end
end
When I try to validate like this:OfferInputsSchema.call(inputs:[{}]
then the errors handling is okay: errors={:inputs=>{0=>{:id=>["is missing"], :items=>["is missing"]}}}
But in case of OfferInputsSchema.call(inputs:[] There are no errors errors={}. How that’s possible?
Hm, I don’t know exactly how to do it, because I see in examples that it could be done by: filled(:array?, min_size?: 1) but I am not sure how to approach in case of .array(:hash).
I tried .filled(:array?, min_size?:1, :hash), but without success.