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
And the ErrorCompiler has no #visit_group method, which means it goes through to #method_missing and just returns {value: args[1]} output for the validation result's #messages, i.e.
Because it goes through #method_missing in the error compiler, it means it never actually tries to look up an i18n/yml key for the translated error message for that validation failure.
Is my understanding of this correct? Is this just a matter of updating the ErrorCompiler to support groups? Or have I missed some already existing way to actually provide human-friendly error messages for failures like this?
Thanks :)
The text was updated successfully, but these errors were encountered:
Cool, thanks for confirming. I can try take a stab at this, if you like (though it might have to be across the next couple of weeks). Is there anything you'd like to see here, for example around the names of the lookup keys for the messages?
If I have a schema like this:
And call it with invalid confirmation data:
Then it looks like it's not possible to provide YML or i18n data to provide a human-friendly error message for that validation failure.
The reason for this is that the error AST entry for that failure has a
:group
in it:And the
ErrorCompiler
has no#visit_group
method, which means it goes through to#method_missing
and just returns{value: args[1]}
output for the validation result's#messages
, i.e.Because it goes through
#method_missing
in the error compiler, it means it never actually tries to look up an i18n/yml key for the translated error message for that validation failure.Is my understanding of this correct? Is this just a matter of updating the
ErrorCompiler
to support groups? Or have I missed some already existing way to actually provide human-friendly error messages for failures like this?Thanks :)
The text was updated successfully, but these errors were encountered: