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): allow multiple self-referencing discriminator schemas using Schema.prototype.discriminator #15142

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

vkarpov15
Copy link
Collaborator

Fix #15120

Summary

#15120 is caused by us reapplying embedded discriminators unnecessarily to cloned schematypes - when a schematype is clone()-ed, we also copy over the discriminator settings. So no need to reapply discriminators later. When cloning a schematype with discriminators, also copy the _appliedDiscriminators flag.

Examples

@vkarpov15 vkarpov15 added this to the 8.9.4 milestone Jan 1, 2025
@vkarpov15 vkarpov15 merged commit ddd6f83 into master Jan 2, 2025
74 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-15120 branch January 2, 2025 20:00
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.

Error on defining more than one self-referencing discriminated schema
2 participants