Hi all,
I am trying to define a schema with a custom type being a dry types hash map:
schema = Dry::Schema.Params do
optional(:hash).filled(Dry::Types['hash'].map(Integer, Array))
end
And I get the following error:
NoMethodError: undefined method `visit_map' for #<Dry::Schema::PredicateInferrer::Compiler:0x0000000008711bc0>
Did you mean? visit_and
visit_any
visit_sum
visit_lax
visit_hash
What am I missing here?
EDIT:
It looks like I can work around this by using a constructor:
schema = Dry::Schema.Params do
optional(:hash).filled(Dry::Types['hash'].constructor { |values| Dry::Types['hash'].map(Integer, Array)[values] })
end
I admit however the form I tried to use initially would be more convenient.