-
-
Notifications
You must be signed in to change notification settings - Fork 629
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
Add field-level pre/post-load API #2787
Comments
Why is this considered a breaking change? |
sorry for the confusion. The breaking change refers to the 'validators transform values' alternative, not the proposed approach |
on second thought, i don't think field-level pre/post-dump makes as much sense as pre/post-load. field-level transformations are much less common on serialization than in deserialization, and custom fields already address the rare cases when they're necessary. |
I also have medium confidence that |
proof of concept of the pre_load and post_load parameters in #2799 |
As suggested by @lafrech in #2786 (review), we can enable pre/post-load on fields to address use cases like whitespace trimming (#1391) via an API similar to the schema-level pre/post_load/dump API.
Something like:
@pre/post_load
Alternatives considered
Allow validators to transform values
The text was updated successfully, but these errors were encountered: