eAPD
eAPD copied to clipboard
[Maintenance] Remove AJV Validation
MongoDB provides some level of built-in validation checking. With that along with Joi for admin check validation we likely no longer have a need for AJV validation. The validations it provides can be replaced by mongos built-in validations. We should devise a plan on how best to remove it and how to move its validations to Mongo's built-ins
This task is done when...
- [ ] Determine best path forward for validation architecture
- [ ] Remove/update validations based on new validation architecture
In addition to the above we should consider moving our validations to Mongo's pre function- https://mongoosejs.com/docs/middleware.html#pre
Both the mongo validation and the adminCheck validations could be run within the pre