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.recompileSchema() also re-apply discriminators #14500

Merged
merged 3 commits into from Apr 7, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14444

Summary

Right now recompileSchema() applies most schema changes, but not additional Schema.prototype.discriminator() or SchemaType.prototype.discriminator() calls. This PR makes recompileSchema() go through and reapply every discriminator that was added to the schema.

Examples

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, though some test nitpicks

lib/model.js Outdated Show resolved Hide resolved
test/model.test.js Outdated Show resolved Hide resolved
test/model.test.js Outdated Show resolved Hide resolved
test/model.test.js Outdated Show resolved Hide resolved
test/model.test.js Show resolved Hide resolved
@vkarpov15 vkarpov15 merged commit b729474 into master Apr 7, 2024
34 checks passed
@vkarpov15 vkarpov15 added this to the 8.3.1 milestone Apr 7, 2024
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14444 branch April 7, 2024 21:47
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.

Recompiling schema does not reapply discriminators
2 participants