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
I would like to customize some error message in the if/then/else logic. But it seems that ajv is not support that or I make some mistakes. Does anyone know how to do it? Thanks in advance.
There is currently no standard for outputting error messages, or defining error messages.
For discussion on adding this to the spec, please follow #396
Hi experts,
I would like to customize some error message in the if/then/else logic. But it seems that ajv is not support that or I make some mistakes. Does anyone know how to do it? Thanks in advance.
Following is a example...
Example:
const schema_motor = {
if: {
properties: {
dad_phone_number: {
type: 'number',
}
},
errorMessage: {
properties: {
dad_phone_number: 'Dad's phone number is incorrect.'
}
}
},
then: true,
else: {
properties: {
mum_phone_number: {
type: 'number'
}
},
errorMessage: {
properties: {
mum_phone_number: 'Mum's phone number is incorrect.'
}
}
@epoberezkin
The text was updated successfully, but these errors were encountered: