# Matching optional params schema against a nested schema

**URL:** <https://discourse.dry-rb.org/t/matching-optional-params-schema-against-a-nested-schema/1069>\
**Category:** Support\
**Created:** [June 15, 2020, 3:03am UTC](https://discourse.dry-rb.org/t/matching-optional-params-schema-against-a-nested-schema/1069 "2020-06-15T03:03:57Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pat](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/pat/32/514_2.png) [@pat](https://discourse.dry-rb.org/u/pat)\
**Post date:** [June 16, 2020, 10:48am UTC](https://discourse.dry-rb.org/t/matching-optional-params-schema-against-a-nested-schema/1069/4 "2020-06-16T10:48:27Z")

</div>

Thanks for that suggested solution @solnic - it’s a bit neater than mine! - though the app I’m working within expects either nil or a hash matching the nested schema, so the translation of an empty string to an empty hash doesn’t quite work out in my particular case.

I can stick with the value coercer for the moment, but certainly if there are suggestions on something neater that returns nil rather than an empty hash, I’d love to hear about them 🙂

---

_[View the full topic](https://discourse.dry-rb.org/t/matching-optional-params-schema-against-a-nested-schema/1069)._
