Apply nested schema to all values of a hash

Thx for your quick answer @flash-gordon, and for the hint. I cannot find any example for this kind of situation, if you have a few minutes, could you please help me with that part (iterating over keys)?

I can guess that it starts with something like this, but I’m still confused on the validation part:

rule(:paths) do
  value.each do |(k, value)|
    # How to check that `value` matches a specific schema, AND to set the errors at the correct path?
    # Something like...
    key([:paths, k]).failure('invalid') if #what ?
    # But how to merge error messages of the nested schema test?
  end
end   

Thanks a lot.