longshotlabs / simpl-schema

A JavaScript schema validation package that supports direct validation of MongoDB update modifier objects
https://www.npmjs.com/package/simpl-schema
MIT License
560 stars 114 forks source link

Fix `keys` validation option not being respected #479

Closed JorgenVatle closed 6 months ago

JorgenVatle commented 1 year ago

Ran into an issue after upgrading to v3 where they keys validation option would not be respected anymore.

This pull request adds a check to the final doValidation() filter, where any errors not matching the provided keysToValidate argument are discarded.

Reference #477

aldeed commented 6 months ago

Thanks! Fixed a different way in https://github.com/longshotlabs/simpl-schema/commit/ded2a356537db3d14e20aca6decfccfe44fcafdf