Empty array in array of hashes - no errors

I have dry-schema like this:

 OfferInputsSchema = Dry::Schema.Params do
  required(:inputs).array(:hash) do
  required(:items).array(:hash) do

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?

You haven’t specified a minimum size for the array, so zero elements is valid.

I think you do that by adding a min_size: 1 predicate to the array method arguments

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.

Ah, sorry, looks like you have to expand it - see the last example in https://dry-rb.org/gems/dry-schema/1.4/nested-data/

required(:people).value(:array, min_size?: 1).each do
  hash do

You’re completely right! Thank you @ZimbiX