brandur/json_schema

Custom validators

Closed this issue · 0 comments

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.