I am using express-validator
in my express app, and I am attempting to prevent additional fields being specified on POST requests. This is because I am passing the value of req.body
to my ORM to insert into the database, and I want to avoid having to explicitly map between my inserted object and request body alongside adding validators.
Is this possible? I can't seem to find it in the documentation. Using JSON Schema you can do this with additionalProperties: false