JSV icon indicating copy to clipboard operation
JSV copied to clipboard

Enhance validation report message by adding the name of the property being validated

Open lauterry opened this issue 11 years ago • 1 comments

Hi

I think it would be a good idea to add the name of the property being validated by the schema 'json-schema-draft-03.js' in the friendly error message.

For now, if a json property such as 'address' for example does not respect the defined maxlength, the following message is :

String is greater than the required maximum length : 2 .

It would be more revelant to have a messsage such as :

Property [address] of type [String] is greater than the required maximum length : 150

This message can help us debug application by providing the name of the property which failed the validation.

Best regards

Thierry LAU

lauterry avatar Nov 29 '12 10:11 lauterry