# Hash? validation doesn't work with string keys?

**URL:** <https://discourse.dry-rb.org/t/hash-validation-doesnt-work-with-string-keys/742>\
**Category:** dry-validation\
**Created:** [March 19, 2019, 6:17pm UTC](https://discourse.dry-rb.org/t/hash-validation-doesnt-work-with-string-keys/742 "2019-03-19T18:17:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoahRGuy](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@NoahRGuy](https://discourse.dry-rb.org/u/NoahRGuy)\
**Post date:** [March 19, 2019, 6:17pm UTC](https://discourse.dry-rb.org/t/hash-validation-doesnt-work-with-string-keys/742/1 "2019-03-19T18:17:34Z")

</div>

Hi! I’m trying to integrate dry-validation into a project of mine, and I’m noticing that it doesn’t work if you use a string as the key (i.e. `{ 'example_key' => example_value}`. Is this intended? Or is there a way to work with hashes that use this format?

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/solnic/32/779_2.png) [@solnic](https://discourse.dry-rb.org/u/solnic)\
**Post date:** [March 20, 2019, 8:32pm UTC](https://discourse.dry-rb.org/t/hash-validation-doesnt-work-with-string-keys/742/2 "2019-03-20T20:32:59Z")

</div>

Which schema type did you use? Please provide some code examples.

---

<div class="post-metadata">

**Author:** ![NoahRGuy](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@NoahRGuy](https://discourse.dry-rb.org/u/NoahRGuy)\
**Post date:** [March 20, 2019, 8:46pm UTC](https://discourse.dry-rb.org/t/hash-validation-doesnt-work-with-string-keys/742/3 "2019-03-20T20:46:34Z")

</div>

An example of how the schema was set up would be like this:  
Dry::Validation.Schema do  
required(:example\_hash) { filled? \> hash }  
end

Which would be filled in by a hash that is formatted like this: `example_hash: { 'a' => 1 }`

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/solnic/32/779_2.png) [@solnic](https://discourse.dry-rb.org/u/solnic)\
**Post date:** [March 22, 2019, 10:58am UTC](https://discourse.dry-rb.org/t/hash-validation-doesnt-work-with-string-keys/742/4 "2019-03-22T10:58:54Z")

</div>

For string keys you want `Dry::Validation.Params do ... end`.
