brandur / json_schema

A JSON Schema V4 and Hyperschema V4 parser and validator.
MIT License
230 stars 45 forks source link

Custom validators #38

Closed nornagon closed 8 years ago

nornagon commented 8 years ago

It would be super handy to be able to register custom validators, e.g. for domain-specific format patterns. Mostly I want to do this to improve on the error message given by pattern, which isn't very human-friendly:

#/groups/0/transfer/0/from: bad1 does not match /^[^\/]+\/[A-Za-z][0-9]+$/.

I'd rather:

#/groups/0/transfer/0/from: bad1 is not a valid well.

It'd also be handy to be able to inject totally custom validators, not just new formats.