You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oops! my bad
I can avoid the error myself by detecting keys.empty? in my macro.
resolved_value,base_path=ifkeys.empty?[values.data,[]]else[value,path.keys]end# use resolved_value and base_path for validations
If I call value as I described initially, the error will be triggered.
I'll leave this thread open and let the maintainer decide whether the inconsistencies are something to be handled by dry-rb, or by consumers. I would understand if there is no good solution for the library, though.
Feel free to close the thread if that is the case.
Describe the bug
I extracted a macro into a reusable module, like this:
and use it like this:
which works fine.
But I cannot use it on the root hash, like this:
Expected behavior
The macro should validate the root hash the same way as when I use it on an inner hash.
Actual behavior
dry-validation throws an
ArgumentError
My environment
Suggestion
Probably adding
around here.
The text was updated successfully, but these errors were encountered: