# Dynamic schema depending on values

**URL:** <https://discourse.dry-rb.org/t/dynamic-schema-depending-on-values/878>\
**Category:** Uncategorized\
**Created:** [August 6, 2019, 12:30pm UTC](https://discourse.dry-rb.org/t/dynamic-schema-depending-on-values/878 "2019-08-06T12:30:37Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![BroiSatse](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/broisatse/32/435_2.png) [@BroiSatse](https://discourse.dry-rb.org/u/BroiSatse)\
**Post date:** [August 6, 2019, 12:30pm UTC](https://discourse.dry-rb.org/t/dynamic-schema-depending-on-values/878/1 "2019-08-06T12:30:37Z")

</div>

I am currently building payment system and I wonder if there is a way of defining dynamic schema depending on values of other params.

Ideally I’d be looking for sth like:

```auto
schema do
  required(:adapter).filled(:string).filled? do |value|
    required(:params).schema(adapter_schemas[value])
  end
end

```

Just starting with dry-validate, so sorry if I miss anything obvious.

---

_[View the full topic](https://discourse.dry-rb.org/t/dynamic-schema-depending-on-values/878)._
