-
-
Notifications
You must be signed in to change notification settings - Fork 352
Closed
Labels
clarificationItems that need to be clarified in the specificationItems that need to be clarified in the specificationvalidation
Description
A continuation of json-schema/json-schema#183
Add a "messages" property to define custom messages for validation keys.
Example:
{
title: "Name",
type: "String",
minLength: 4,
maxLength: 6,
messages: {
minLength: "Your name must be at least four characters long.",
maxLengh: "Your name must be no more than six characters long"
}
}
Custom messages of an implementation could allow for template vars. Also consider:
{
title: "Password",
type: "pattern",
pattern: '^[a-zA-Z0-9@#\\$%]{8,20}$',
messages: {
pattern: "%title% must be 8-20 characters and must contain only alpha-numeric character or the following @, #, $, %"
}
}
Related:
geraintluff/tv4#115
geraintluff/tv4#206
json-schema/json-schema#183
silverbucket, leonardosnt, revolunet, pvgomes, AlexeyAtIgloo and 6 morebritishtea and epoberezkin
Metadata
Metadata
Assignees
Labels
clarificationItems that need to be clarified in the specificationItems that need to be clarified in the specificationvalidation
Type
Projects
Status
Closed