Skip to content

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

Merged
vkarpov15 merged 2 commits intomasterfrom
vkarpov15/gh-15164
Jan 9, 2025
Merged

fix(model): make Model.validate() static correctly cast document arrays#15169
vkarpov15 merged 2 commits intomasterfrom
vkarpov15/gh-15164

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
Co-authored-by: hasezoey <hasezoey@gmail.com>
@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