Open swbloom opened 7 years ago
I was looking at different validation strategies for express, and it looks like validation middleware is a common pattern for ensuring properly formatted requests. @Rchristiani what do you think of something like this: https://www.npmjs.com/package/express-validator
My concerns about it is that it might make a lot of our tests fail (though maybe that's a good thing?)
I can put together a proof of concept on a branch if you think it's something worth exploring
Will look into it, but it probably makes more sense to do it via Mongoose http://mongoosejs.com/docs/validation.html
Currently, the API will let you create new documents that receive request bodies that are malformed (missing payload data, IDs pointing to instructors that don't exist).
The API should validate requests and reject improperly formatted ones.