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
{{ message }}
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.
The default validation messages attempt to turn the property name into something human readable, but this is not good if you're trying to provide specific information about a config property or something else that should tell the developer which property failed the validation.
I was wondering if there was a placeholder to get the original property name.
For example, if have this definition right now:
const rules = {
apiBaseUrl: {
url: {
message: `^- apiBaseUrl: Expected a URL, given %{value} instead.
},
},
clientBaseUrl: {
url: {
message: `^- clientBaseUrl: Expected a URL, given %{value} instead.
},
}
};
I should be able to generalize this message and assign it to the URL validator generically with a message like this:
"^%{property}: Expected a URL, given %{value} instead."
Where %{property} is the exact name of the property being validated, rather than a human readable version.
Is this possible in the current version, if not then I'd like to make this a feature request.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The default validation messages attempt to turn the property name into something human readable, but this is not good if you're trying to provide specific information about a config property or something else that should tell the developer which property failed the validation.
I was wondering if there was a placeholder to get the original property name.
For example, if have this definition right now:
I should be able to generalize this message and assign it to the URL validator generically with a message like this:
Where
%{property}
is the exact name of the property being validated, rather than a human readable version.Is this possible in the current version, if not then I'd like to make this a feature request.
The text was updated successfully, but these errors were encountered: