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(schema): avoid creating unnecessary clone of schematype in nested array so nested document arrays use correct constructor #14128

Merged
merged 1 commit into from Dec 1, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #14101

Summary

The underlying issue in #14101 is that we have two different schema types for options and options.$, even though they should be the same. Which leads to issues when validating a subdoc of options.$'s caster using options schematype. Specifically triggering this if statement, which leads to issues with nested arrays because scope can be an array.

The fix is to avoid cloning, so options and options.$ are largely interchangeable as far as casting and validation are concerned.

Examples

… array so nested document arrays use correct constructor

Fix #14101
@vkarpov15 vkarpov15 added this to the 8.0.3 milestone Dec 1, 2023
@vkarpov15 vkarpov15 merged commit d423b0e into master Dec 1, 2023
38 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14101 branch December 1, 2023 14:48
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.

ValidatorError not catched by try/catch
2 participants