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

BREAKING CHANGE: make Model.validate() use Model.castObject() to cast, and return casted copy of object instead of modifying in place #13827

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #12668

Summary

Model.validate() currently modifies the passed in object for casting purposes, which is inconsistent with how Model.castObject() works and can leave the passed-in object in a half-casted state if there's a cast error. This PR makes Model.validate() use Model.castObject() to create a casted copy of obj, and run validation on all paths that successfully casted.

Examples

…cast, and return casted copy of object instead of modifying in place

Fix #12668
@vkarpov15 vkarpov15 added this to the 8.0 milestone Sep 8, 2023
@vkarpov15 vkarpov15 merged commit 49a00ea into 8.0 Sep 8, 2023
40 of 42 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-12668 branch September 8, 2023 18:39
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.

None yet

2 participants