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
The custom message feature allows a user to specify a custom validation message based on the type of validation. However, this is limited in that you can only have one message per type.
It would be nice if it was possible to specify this at each attribute, for example
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"firstName": {
"type": "string",
"description": "The person's first name.",
"message": {
"type": "Invalid type, should be string"}
},
"foo": {
"type": "array",
"maxItems": 3,
"message": {
"maxItems" : "MaxItem must be 3 only",
"type" : "Invalid type, should be array"
}
}
}
}
The text was updated successfully, but these errors were encountered:
@Tim-fors While thinking about it, it is not easy to do to cover all the scenarios. Also, I think this should be a joint effort with the spec team. As of now, they don't want to define the messages in the schema but I think it would be a good option. Do you want to open a discussion over there to see what is the response from the spec team? Thanks.
Continuation of discussion from #440 (comment)
The custom message feature allows a user to specify a custom validation message based on the type of validation. However, this is limited in that you can only have one message per type.
It would be nice if it was possible to specify this at each attribute, for example
The text was updated successfully, but these errors were encountered: