Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(model): make Model.validate() static correctly cast document arrays #15169

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

vkarpov15
Copy link
Collaborator

Fix #15164

Summary

#15075 fix unintentionally made it so that Model.validate() skips document arrays if the value being casted is an array. This PR fixes that.

Examples

@vkarpov15 vkarpov15 added this to the 8.9.4 milestone Jan 8, 2025
lib/model.js Outdated Show resolved Hide resolved
Co-authored-by: hasezoey <[email protected]>
@vkarpov15 vkarpov15 merged commit 7ca1847 into master Jan 9, 2025
74 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-15164 branch January 10, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mongoose 8.x: Required array schema validation breaks in static validation
2 participants