# Does Hash.map work in a validation schema?

**URL:** <https://discourse.dry-rb.org/t/does-hash-map-work-in-a-validation-schema/1948>\
**Category:** dry-validation\
**Created:** [October 30, 2025, 1:28am UTC](https://discourse.dry-rb.org/t/does-hash-map-work-in-a-validation-schema/1948 "2025-10-30T01:28:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashley\_E](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/ashley_e/32/1054_2.png) [@Ashley\_E](https://discourse.dry-rb.org/u/Ashley_E)\
**Post date:** [October 30, 2025, 1:28am UTC](https://discourse.dry-rb.org/t/does-hash-map-work-in-a-validation-schema/1948/1 "2025-10-30T01:28:35Z")

</div>

I have a schema that has an optional Hash. That Hash is always a \<string, string\> type, and the Hash can be empty. I’m trying to write a validation Contract for that.

The `dry-types` documentation has [a definition and example for a Map.](https://dry-rb.org/gems/dry-types/main/map/) And yet when I use that in my validation Contract, I get a ‘NotImplemented’ error with the message “map types are not supported yet”

Here’s a minimal example:

```auto

require "dry-validation"

StringStringMap = ::Dry::Types['hash'].map(::Dry::Types['string'], ::Dry::Types['string'])

class StringStringMapContract < Dry::Validation::Contract
  schema do
    optional(:properties).value(StringStringMap)
  end
end

```

Does `Map` work with validation or schema? If so, what am I missing? (I’ve only recently started using dry-rb, so it’s very probably that it’s my error.)  
If not, the documentation should be updated – perhaps for all 3 gems (`dry-types`, `dry-schema`, `dry-validation`) noting the context where `Map` does and does not work.

I’m using the latest versions of the gems. ruby 3.4.5
