Leaf nodes validation not working correctly after upgrade mongoose >= 6.3.1 #12021
Closed
2 tasks done
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Prerequisites
Mongoose version
6.4.1
Node.js version
16.15.1
MongoDB server version
5.0.0
Description
After upgrading mongoose ta a version grater than
6.3.0
, the validation stopped working in some conditions.If a schema is created with leaf nodes, then the validation is only performed if the property is required.
Steps to Reproduce
Runkit 6.3.0 https://runkit.com/embed/r0jhjsjztl99
Runkit 6.3.1 https://runkit.com/embed/ylkawc9mlm1s
Runkit latest https://runkit.com/embed/s553idqmvs9x
Expected Behavior
Both leaf and non leaf nodes should be validated the same way.
The text was updated successfully, but these errors were encountered: