Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lauterry opened this issue Nov 29, 2012 · 1 comment

Comments

@lauterry
Copy link

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

@alfonsoabad
Copy link

I've created a branch in my fork https://github.com/alfonsoabad/JSV/tree/descriptive-errors with those descriptive messages implemented for draft 3 only, I'll be doing the pull request once it's tested, may be you can help me to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants