Closed blissi closed 6 years ago
Hi!
It is totally possible to replace the default ( probably outdated ) validator with something else. We use in production ajv.
With that being said, the validator must validate the (command) object against JSON schemas, which in my opinion is a far better option than JOI taking into account its standardisation cross-language and cross-platfrom support.
Alternatively you could implement completely custom validations in pre-load-conditions ( the validation is basically the same ) and throw validation errors as wish there.
If you decide to go with the JSON schema way, i would be more than happy to provide you with an example that uses custom validator.
@nanov I'm not limited to Joi and would highly appreciate your ajv-example.
I am on it.
Ok,
I've tried to come up with something quickly. I will continue to update those examples when I find the time as i truly believe those are useful.
As per your specific question :
Complete AJV validation and error reporting is implemented in this example. Take a look at it and how it works, and let me know if this is helpful.
Thanks, that's definately helpful! I'll play around with it.
Hallo,
I'd like to use Joi for validating the commands. Is it possible to replace the built-in t4-validation with something different? What's the purpose of the validator extension? Can it be used for this?
Thanks, Steven