I have an application in Node.js that have a REST service, this service (with POST Method) accept a JSON passed as payload in the body request.
The JSON payload is parsed so I have an Object, at this point I'd like check that all mandatory fields are presents.
I have to check it field by field or there is a way to compare the object to a defined schema?
Which is the best approch?
You can try
Joi
for schema creation and validating.