-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behaviour with array of hashes #410
Comments
What about |
Yes, this syntax also works in my scenario. |
OK so this is because passing a schema to |
I guess can a schema by anything but a hash? if not than i think setting :hash would be a sensible default. Judging by the exception; dry-schema itself thinks that a schema should be a hash. |
Yes it assumes a hash but that's just because applying a schema doesn't have Anyhow, that's why we have macro methods that combine complex checks for you :) Like I said, passing an instance of a schema could assume you want I need to dig into this more to figure out a good solution, but it sounds like a 2.0.0 task, because it may potentially be a breaking change. |
Describe the bug
Reusing a schema directly in the the array macro produces an unexpected exception when passed bad data.
To Reproduce
If you correctly pass it in an array of hashes it will happily work
Expected behavior
Should work the same as the long form expression; or not work at all.
My environment
Running the latest and greatest versions of dry-schema (1.9.2)
The text was updated successfully, but these errors were encountered: