Open cspotcode opened 9 years ago
That would be possible, yes. @mafintosh what do you think? Any reasons not to add the technical validation message?
This could be made as part of #38. It would use schema
instead of rule
, and it would have some more information, but it should be easy to extract only the rule
part of the full schema
reference.
I was thinking of using this to validate data and then show friendly errors to the user, so I'd have to map the errors from is-my-json-valid onto some user-friendly messages. I could do this if each errors object contained the name of the rule in question ("minLength", "required", etc) Is that something that could be added to the "verbose" mode?
EDIT added example: