# Possibility to remove constraints from a type

**URL:** <https://discourse.dry-rb.org/t/possibility-to-remove-constraints-from-a-type/1767>\
**Category:** dry-types\
**Created:** [January 24, 2024, 5:03pm UTC](https://discourse.dry-rb.org/t/possibility-to-remove-constraints-from-a-type/1767 "2024-01-24T17:03:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexWayfer](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/alexwayfer/32/895_2.png) [@AlexWayfer](https://discourse.dry-rb.org/u/AlexWayfer)\
**Post date:** [January 24, 2024, 5:03pm UTC](https://discourse.dry-rb.org/t/possibility-to-remove-constraints-from-a-type/1767/1 "2024-01-24T17:03:26Z")

</div>

Similar to [How to remove a default from `dry-types` custom class attribute?](https://discourse.dry-rb.org/t/how-to-remove-a-default-from-dry-types-custom-class-attribute/1727)

But with any constraints.

Life example:

We have `attribute? :max_quantity, Types::Integer.constrained(gteq: 1, lteq: 10)`.

In console it looks like `#<Dry::Types[Constrained<Nominal<Integer> rule=[type?(Integer) AND gteq?(1) AND lteq?(10)]>]>`.

I’d like to get `#<Dry::Types[Constrained<Nominal<Integer> rule=[type?(Integer)]>]>`.

`.type`, as for default, doesn’t help: it returns `#<Dry::Types[Nominal<Integer>]>`.

So, I’d like to have something like `.constraints`, which returns `Hash`, which I can modify or re-use as options for a new type.

Or, I saw internal `.with` method, probably we need for something like `.without`.

What do you think?
