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
Hey, nice library. Im wondering if its possible to expose the errors for nested structs currently I am using the Vex.Struct module and defining a custom function for validating a nested structure i.e.
validates :nested, &NestedVexStruct.valid?/1
This works great and gives me the ability to run the nested validations but if it fails the error I get is only associated with this top level validator and not the actual causes in the sub validator. Any ideas around this?
The text was updated successfully, but these errors were encountered:
I realize that since this question has been asked hoverboards have been invented.. however, the following seems to work well for me (so far):
validates :nested, &Vex.validate/1
.validate instead of .valid? to propagate the error message. This works for me since my nested struct implements use Vex.Struct. Otherwise I noticed nested fields are somewhat supported:
Hey, nice library. Im wondering if its possible to expose the errors for nested structs currently I am using the
Vex.Struct
module and defining a custom function for validating a nested structure i.e.validates :nested, &NestedVexStruct.valid?/1
This works great and gives me the ability to run the nested validations but if it fails the error I get is only associated with this top level validator and not the actual causes in the sub validator. Any ideas around this?
The text was updated successfully, but these errors were encountered: