ostrowr / ts-json-validator

Let JSON play nicely with Typescript
MIT License
342 stars 7 forks source link

Add support of ajv-errors #36

Closed nordluf closed 4 years ago

nordluf commented 4 years ago

is it possible to add support of https://github.com/ajv-validator/ajv-errors ? Keyword errorMessage can't be the part of a schema atm, and initialization is not possible as well.

ostrowr commented 4 years ago

I'm hesitant to add errorMessage to the schema as a one-off, but I think adding a set of custom keywords you want should be pretty straightforward. This seems like a necessary feature for anyone using ts-json-validators with plugins so I'll take care of this as soon as I can. (PRs also welcome, of course!

ostrowr commented 4 years ago

For custom keywords (not just error messages) this is a dupe of #35 , so I'm closing in favor of that one.