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(discriminator): make base schema paths come before discriminator schema paths when running setters, validators, etc. #13846

Merged
merged 3 commits into from Sep 15, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13794

Summary

Right now, discriminators add base schema paths to the child schema, which means that setters and validators on child schema paths run before setters and validators on base schema paths. This PR switches that order.

While this PR doesn't break any of our tests, I'm considering merging it into 8.0 branch just in case. Any thoughts @hasezoey @AbdelrahmanHafez ?

Examples

…schema paths when running setters, validators, etc.

Fix #13794
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 to me, though one question

lib/helpers/model/discriminator.js Outdated Show resolved Hide resolved
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.

LGTM, aside from the base-branch merge conflicts

@vkarpov15 vkarpov15 changed the base branch from master to 8.0 September 15, 2023 14:37
@vkarpov15 vkarpov15 merged commit 71fce29 into 8.0 Sep 15, 2023
40 of 41 checks passed
@vkarpov15 vkarpov15 added this to the 8.0 milestone Sep 15, 2023
@hasezoey hasezoey deleted the vkarpov15/gh-13794 branch September 15, 2023 17:20
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.

Wrong field processing order with discriminators
2 participants