# Support

**URL:** https://discourse.dry-rb.org/c/support/9.md?no_subcategories=false&page=1

[Latest](https://discourse.dry-rb.org/latest.md) · [Categories](https://discourse.dry-rb.org/categories.md)

**Page:** 2

---

## [Define a Hash param that also accepts a String that is validates \*then\* parsed](https://discourse.dry-rb.org/t/define-a-hash-param-that-also-accepts-a-string-that-is-validates-then-parsed/1799)

<div class="topic-metadata">

**Author:** [@postmodern](https://discourse.dry-rb.org/u/postmodern)\
**Replies:** 1\
**Last updated:** [May 10, 2024, 5:18pm UTC](https://discourse.dry-rb.org/t/define-a-hash-param-that-also-accepts-a-string-that-is-validates-then-parsed/1799 "2024-05-10T17:18:55Z")

</div>

I’m wondering how one would define a Hash param (ex: for HTTP headers) that accepts a String, which is first validated using a Regex, then parsed into a Hash. I know about dry-types .constructor and dry-validations’s bef…

---

## [Dynamic schema with Configurable's option/param](https://discourse.dry-rb.org/t/dynamic-schema-with-configurables-option-param/1800)

<div class="topic-metadata">

**Author:** [@freesteph](https://discourse.dry-rb.org/u/freesteph)\
**Replies:** 0\
**Last updated:** [May 9, 2024, 11:00am UTC](https://discourse.dry-rb.org/t/dynamic-schema-with-configurables-option-param/1800 "2024-05-09T11:00:27Z")

</div>

Hello, I’ve been scratching my head for a couple hours but I can’t figure out how to do this: require "dry-validation" class MySchema \< Dry::Validation::Contract option :sizes, default: -\> { %w\[small medium large\] }…

---

## [How do I use a macro with an optional property?](https://discourse.dry-rb.org/t/how-do-i-use-a-macro-with-an-optional-property/822)

<div class="topic-metadata">

**Author:** [@shepmaster](https://discourse.dry-rb.org/u/shepmaster)\
**Replies:** 15\
**Last updated:** [May 1, 2024, 6:35pm UTC](https://discourse.dry-rb.org/t/how-do-i-use-a-macro-with-an-optional-property/822 "2024-05-01T18:35:03Z")

</div>

I ran into enough troubles attempting to use dry-validation 0.13 that I’m looking at 1.0. Based on my understanding, predicates are gone and built-in tools like gt? are gone. It appears that the replacements are macros. …

---

## [Ability to apply rules to external schema](https://discourse.dry-rb.org/t/ability-to-apply-rules-to-external-schema/1020)

<div class="topic-metadata">

**Author:** [@otov](https://discourse.dry-rb.org/u/otov)\
**Replies:** 5\
**Last updated:** [April 15, 2020, 9:05am UTC](https://discourse.dry-rb.org/t/ability-to-apply-rules-to-external-schema/1020 "2020-04-15T09:05:17Z")

</div>

Is there a trick to making rules work when a rule path refers to a key in re-used schema? AddressSchema = Dry::Schema.Params do required(:country).value(:string) required(:zipcode).value(:string) required(:street)…

---

## [Alias container key names](https://discourse.dry-rb.org/t/alias-container-key-names/1792)

<div class="topic-metadata">

**Author:** [@dlinch](https://discourse.dry-rb.org/u/dlinch)\
**Replies:** 0\
**Last updated:** [April 16, 2024, 11:05pm UTC](https://discourse.dry-rb.org/t/alias-container-key-names/1792 "2024-04-16T23:05:44Z")

</div>

We are running into a scenario where several different key names would resolve to the same namespace. Specifically, we’re resolving different “flows” with different customers and their unique slugs are the container name…

---

## [Conditional required field using dry-schema](https://discourse.dry-rb.org/t/conditional-required-field-using-dry-schema/1786)

<div class="topic-metadata">

**Author:** [@isccha](https://discourse.dry-rb.org/u/isccha)\
**Replies:** 2\
**Last updated:** [March 22, 2024, 2:33pm UTC](https://discourse.dry-rb.org/t/conditional-required-field-using-dry-schema/1786 "2024-03-22T14:33:28Z")

</div>

Hi, I’d like to create a simple schema where a bar field is needed if other foo bar is not present. For example, {foo: 'some value'} should pass validation, but {baz: 'value'} should not, because bar is not present. …

---

## [Rule order matters in schema?](https://discourse.dry-rb.org/t/rule-order-matters-in-schema/1784)

<div class="topic-metadata">

**Author:** [@sakuro](https://discourse.dry-rb.org/u/sakuro)\
**Replies:** 0\
**Last updated:** [March 17, 2024, 7:18am UTC](https://discourse.dry-rb.org/t/rule-order-matters-in-schema/1784 "2024-03-17T07:18:23Z")

</div>

Following two schemata are identical except order of :format? and :min\_size? but their outputs are different. Is this intended? require "dry/schema" Dry::Schema.load\_extensions(:hints) format\_first = Dry::Schema.Para…

---

## [dry-schema: split string, validate elements against enum](https://discourse.dry-rb.org/t/dry-schema-split-string-validate-elements-against-enum/1777)

<div class="topic-metadata">

**Author:** [@dmke](https://discourse.dry-rb.org/u/dmke)\
**Replies:** 5\
**Last updated:** [March 6, 2024, 5:52pm UTC](https://discourse.dry-rb.org/t/dry-schema-split-string-validate-elements-against-enum/1777 "2024-03-06T17:52:58Z")

</div>

Hi, I get a parameter named includes as a comma-separated string, and want to validate that all its elements are within a set of allowed values. I believe, this is conceptually similar to this question, where an input s…

---

## [Defining an attribute name containing a question mark on dry-struct](https://discourse.dry-rb.org/t/defining-an-attribute-name-containing-a-question-mark-on-dry-struct/1774)

<div class="topic-metadata">

**Author:** [@geneg](https://discourse.dry-rb.org/u/geneg)\
**Replies:** 1\
**Last updated:** [February 13, 2024, 12:43pm UTC](https://discourse.dry-rb.org/t/defining-an-attribute-name-containing-a-question-mark-on-dry-struct/1774 "2024-02-13T12:43:12Z")

</div>

Is there a way to define an attribute having a name that ends in a question mark? Dry-struct seems to respect :'my\_attribute??' and create an optional attribute named, my\_attribute?. However, I haven’t found a way to cr…

---

## [Check if type is an enum and list possible values](https://discourse.dry-rb.org/t/check-if-type-is-an-enum-and-list-possible-values/1769)

<div class="topic-metadata">

**Author:** [@mbajur](https://discourse.dry-rb.org/u/mbajur)\
**Replies:** 1\
**Last updated:** [February 6, 2024, 1:49am UTC](https://discourse.dry-rb.org/t/check-if-type-is-an-enum-and-list-possible-values/1769 "2024-02-06T01:49:00Z")

</div>

Hello! Long story short - let’s say i have an array of various dry types, one of them being enum type types\_array = \[Types::Params::String.default('red').enum('red', 'green', 'blue')\]. How can i check if given type ha…

---

## [Possibility to remove constraints from a type](https://discourse.dry-rb.org/t/possibility-to-remove-constraints-from-a-type/1767)

<div class="topic-metadata">

**Author:** [@AlexWayfer](https://discourse.dry-rb.org/u/AlexWayfer)\
**Replies:** 0\
**Last updated:** [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")

</div>

Similar to How to remove a default from \`dry-types\` custom class attribute? But with any constraints. Life example: We have attribute? :max\_quantity, Types::Integer.constrained(gteq: 1, lteq: 10). In console it looks…

---

## [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)

<div class="topic-metadata">

**Author:** [@AlexWayfer](https://discourse.dry-rb.org/u/AlexWayfer)\
**Replies:** 2\
**Last updated:** [September 10, 2023, 12:53pm UTC](https://discourse.dry-rb.org/t/how-to-remove-a-default-from-dry-types-custom-class-attribute/1727 "2023-09-10T12:53:21Z")

</div>

Hello. I’m working on a Ruby gem. Especially its specs. We have custom Dry::Types types. And we’re getting parsed API types for specs. Attributes of our Ruby types have internal defaults, which external API has no. H…

---

## [dry-transaction side effects](https://discourse.dry-rb.org/t/dry-transaction-side-effects/1761)

<div class="topic-metadata">

**Author:** [@lancejjohnson](https://discourse.dry-rb.org/u/lancejjohnson)\
**Replies:** 1\
**Last updated:** [January 2, 2024, 5:20am UTC](https://discourse.dry-rb.org/t/dry-transaction-side-effects/1761 "2024-01-02T05:20:25Z")

</div>

I’m hoping to clarify one of the stated intentions for dry-transaction. In the list of “ideas” supporting dry-transaction is the idea: Each operation shouldn’t accumulate state, instead it should receive an input and r…

---

## [Questions about the dry-system container settings](https://discourse.dry-rb.org/t/questions-about-the-dry-system-container-settings/1730)

<div class="topic-metadata">

**Author:** [@NoComply](https://discourse.dry-rb.org/u/NoComply)\
**Replies:** 3\
**Last updated:** [December 13, 2023, 7:23pm UTC](https://discourse.dry-rb.org/t/questions-about-the-dry-system-container-settings/1730 "2023-12-13T19:23:37Z")

</div>

Hello, I have a hard time understanding how I can change container settings before the container finalization. Let me illustrate my point with a short single file code snippet: # frozen\_string\_literal: true require "…

---

## [dry-validation for file upload](https://discourse.dry-rb.org/t/dry-validation-for-file-upload/1758)

<div class="topic-metadata">

**Author:** [@deHelden](https://discourse.dry-rb.org/u/deHelden)\
**Replies:** 2\
**Last updated:** [November 25, 2023, 1:03pm UTC](https://discourse.dry-rb.org/t/dry-validation-for-file-upload/1758 "2023-11-25T13:03:13Z")

</div>

Is there any “legal” way/idea of validating key type of File? optional(:photo).filled(:file?)

---

## [dry-transformer get a value from hash](https://discourse.dry-rb.org/t/dry-transformer-get-a-value-from-hash/1755)

<div class="topic-metadata">

**Author:** [@igas](https://discourse.dry-rb.org/u/igas)\
**Replies:** 1\
**Last updated:** [November 21, 2023, 5:41pm UTC](https://discourse.dry-rb.org/t/dry-transformer-get-a-value-from-hash/1755 "2023-11-21T17:41:12Z")

</div>

I have an input: { "job\_status": "SUCCEEDED", "expense\_documents": \[ {"type": "total"}, {"type": "tax"} \] } I want to get: \[{"type": "total"},{"type": "tax"}\] Simplified example, I do more processing, b…

---

## [sequencing bug in Dry::AutoInject when using Dry::Configurable](https://discourse.dry-rb.org/t/sequencing-bug-in-dry-autoinject-when-using-dry-configurable/1753)

<div class="topic-metadata">

**Author:** [@jedschneider](https://discourse.dry-rb.org/u/jedschneider)\
**Replies:** 1\
**Last updated:** [November 17, 2023, 4:48pm UTC](https://discourse.dry-rb.org/t/sequencing-bug-in-dry-autoinject-when-using-dry-configurable/1753 "2023-11-17T16:48:18Z")

</div>

Hi Folks, I discovered a small bug today when combining auto inject and instance level config with dry configurable. it seems to be a sequencing issue but I’m not sure which gem should behave more politely: versions: D…

---

## [Trying to combine an array of value](https://discourse.dry-rb.org/t/trying-to-combine-an-array-of-value/1751)

<div class="topic-metadata">

**Author:** [@freesteph](https://discourse.dry-rb.org/u/freesteph)\
**Replies:** 2\
**Last updated:** [November 14, 2023, 6:46pm UTC](https://discourse.dry-rb.org/t/trying-to-combine-an-array-of-value/1751 "2023-11-14T18:46:52Z")

</div>

Hello, I have an array like this: { "address": { "line1": "X", "line2": "Y", "line3": "Z" } } I’m trying to get a resulting hash: { "address\_line1": "X Y Z" }. I can’t figure out how to combine the diff…

---

## [Strange dry-validation / dry-schema bug](https://discourse.dry-rb.org/t/strange-dry-validation-dry-schema-bug/1749)

<div class="topic-metadata">

**Author:** [@postmodern](https://discourse.dry-rb.org/u/postmodern)\
**Replies:** 0\
**Last updated:** [November 7, 2023, 1:28am UTC](https://discourse.dry-rb.org/t/strange-dry-validation-dry-schema-bug/1749 "2023-11-07T01:28:56Z")

</div>

Ran into this NilClass exception coming from dry-logic, via dry-schema and dry-valiation. Code in question: https://github.com/ronin-rb/ronin-app/blob/e7b0b7880f1e5c41a29750596d951ba6b0bb35f1/lib/ronin/app/validations/r…

---

## [Using dry monads mixins in Rails views](https://discourse.dry-rb.org/t/using-dry-monads-mixins-in-rails-views/1743)

<div class="topic-metadata">

**Author:** [@DawidJanczak](https://discourse.dry-rb.org/u/DawidJanczak)\
**Replies:** 1\
**Last updated:** [October 25, 2023, 4:04pm UTC](https://discourse.dry-rb.org/t/using-dry-monads-mixins-in-rails-views/1743 "2023-10-25T16:04:27Z")

</div>

Hello, I was wondering if it’s possible to just use Failure() in a Rails view and if so how to mix those modules in. Simply doing include Dry::Monads\[:result\] in the controller works for the code inside controller actio…

---

## [Do notation and matcher combined for call method not working](https://discourse.dry-rb.org/t/do-notation-and-matcher-combined-for-call-method-not-working/1736)

<div class="topic-metadata">

**Author:** [@pdany1116](https://discourse.dry-rb.org/u/pdany1116)\
**Replies:** 2\
**Last updated:** [October 17, 2023, 8:17pm UTC](https://discourse.dry-rb.org/t/do-notation-and-matcher-combined-for-call-method-not-working/1736 "2023-10-17T20:17:47Z")

</div>

Hi there, Dry-rb libraries beginner here, I was trying to do this: class Create include Dry::Transaction::Operation include Dry::Monads::Do.for(:call) def call(params) result = yield some\_other\_call(params) …

---

## [Execute contract rules also when the schema is not valid?](https://discourse.dry-rb.org/t/execute-contract-rules-also-when-the-schema-is-not-valid/1718)

<div class="topic-metadata">

**Author:** [@sekmo](https://discourse.dry-rb.org/u/sekmo)\
**Replies:** 3\
**Last updated:** [October 12, 2023, 9:50am UTC](https://discourse.dry-rb.org/t/execute-contract-rules-also-when-the-schema-is-not-valid/1718 "2023-10-12T09:50:56Z")

</div>

Hello everyone! I read from the dry-validation rules page that key-specific rules are not executed when the schema is not valid. is there a way to enforce the rules also when the schema is not valid? We’re looking to …

---

## [Several constraints for a type](https://discourse.dry-rb.org/t/several-constraints-for-a-type/1732)

<div class="topic-metadata">

**Author:** [@elcuervo](https://discourse.dry-rb.org/u/elcuervo)\
**Replies:** 0\
**Last updated:** [September 27, 2023, 9:33pm UTC](https://discourse.dry-rb.org/t/several-constraints-for-a-type/1732 "2023-09-27T21:33:42Z")

</div>

Hello! We are expanding our usage of dry-types (as well as the rest of the ecosystem) and I have a question on how to enforce a specific type. Basically I want to check that the given type is an ActiveRecord model that…

---

## [Conflit using Dry Monads and View Component](https://discourse.dry-rb.org/t/conflit-using-dry-monads-and-view-component/1728)

<div class="topic-metadata">

**Author:** [@devaniljr](https://discourse.dry-rb.org/u/devaniljr)\
**Replies:** 2\
**Last updated:** [September 14, 2023, 10:24pm UTC](https://discourse.dry-rb.org/t/conflit-using-dry-monads-and-view-component/1728 "2023-09-14T22:24:44Z")

</div>

I’m having a problem while using ViewComponent with Dry Monads. Here my code: require "dry/monads" class Dashboard::Course::Marketing::StatsComponent \< ViewComponent::Base include Dry::Monads\[:result, :do\] def ini…

---

## [Nested dry-struct serialization](https://discourse.dry-rb.org/t/nested-dry-struct-serialization/1722)

<div class="topic-metadata">

**Author:** [@dorner](https://discourse.dry-rb.org/u/dorner)\
**Replies:** 2\
**Last updated:** [September 5, 2023, 6:16pm UTC](https://discourse.dry-rb.org/t/nested-dry-struct-serialization/1722 "2023-09-05T18:16:25Z")

</div>

Hi! Ultimately what I’m trying to do here is implement ActiveRecord serialization for dry-struct, as mentioned here: dry-struct and serializer I have a struct with reference to another struct, as follows: class Inven…

---

## [Dry::Transaction v1](https://discourse.dry-rb.org/t/dry-transaction-v1/1710)

<div class="topic-metadata">

**Author:** [@santiagodoldan](https://discourse.dry-rb.org/u/santiagodoldan)\
**Replies:** 1\
**Last updated:** [July 27, 2023, 6:46pm UTC](https://discourse.dry-rb.org/t/dry-transaction-v1/1710 "2023-07-27T18:46:44Z")

</div>

Hello everyone :raised\_hand\_with\_fingers\_splayed: Are there any plans about releasing dry-transaction v1? The repo seems a bit inactive, not sure what are the plans for this awesome gem, I’d love to help if there is a c…

---

## [Reusing both schema and rules](https://discourse.dry-rb.org/t/reusing-both-schema-and-rules/1701)

<div class="topic-metadata">

**Author:** [@yoones](https://discourse.dry-rb.org/u/yoones)\
**Replies:** 1\
**Last updated:** [July 10, 2023, 5:47pm UTC](https://discourse.dry-rb.org/t/reusing-both-schema-and-rules/1701 "2023-07-10T17:47:53Z")

</div>

Hello, Is there a way to reuse contracts in full (schema AND rules)? #!/usr/bin/env ruby require 'dry-validation' module Contracts class ApplicationContract \< Dry::Validation::Contract end class AddressContrac…

---

## [dry-system collapse directory](https://discourse.dry-rb.org/t/dry-system-collapse-directory/1699)

<div class="topic-metadata">

**Author:** [@squdge](https://discourse.dry-rb.org/u/squdge)\
**Replies:** 1\
**Last updated:** [July 9, 2023, 7:05am UTC](https://discourse.dry-rb.org/t/dry-system-collapse-directory/1699 "2023-07-09T07:05:04Z")

</div>

How does one go about using dry-system with or without Zeitwerk to collapse directories?

---

## [Raising errors on deprecations](https://discourse.dry-rb.org/t/raising-errors-on-deprecations/1698)

<div class="topic-metadata">

**Author:** [@sporto](https://discourse.dry-rb.org/u/sporto)\
**Replies:** 2\
**Last updated:** [July 4, 2023, 10:33pm UTC](https://discourse.dry-rb.org/t/raising-errors-on-deprecations/1698 "2023-07-04T22:33:21Z")

</div>

When using IRB or running tests I see dry-types deprecation messages. I would like to find all the places where we have to fix deprecations. What I would like is to have our CI raise errors when we use deprecated patte…

---

## [Would it be possible to release a new version of dry-view?](https://discourse.dry-rb.org/t/would-it-be-possible-to-release-a-new-version-of-dry-view/1696)

<div class="topic-metadata">

**Author:** [@rickenharp](https://discourse.dry-rb.org/u/rickenharp)\
**Replies:** 0\
**Last updated:** [June 26, 2023, 10:21am UTC](https://discourse.dry-rb.org/t/would-it-be-possible-to-release-a-new-version-of-dry-view/1696 "2023-06-26T10:21:22Z")

</div>

The version currently available on rubygems is 0.7.1 from February 2021. Since then, there have been quite a lot of fixes to the code, like making it work with the current version of hamlit, or the current version of dry…

[Previous page](https://discourse.dry-rb.org/c/support/9.md?no_subcategories=false)

[Next page](https://discourse.dry-rb.org/c/support/9.md?no_subcategories=false&page=2)
