Setting again a tentative due date, as I'm not sure when I'll be able to look into this.
Basically, I want to enable the usage of custom serializer hooks, which will be run for example before or after from_dict is called, or similarly before or after to_dict is called. I want to allow these to be specified on per-class basis, and also the dataclass does not necessarily have to extend from JSONWizard, it can be just a regular dataclass. This is important, because we need to support the use case where a class inheritance model is not used.
The methods that a class would be able to implement, can be named something like __pre_load__ and __pre_dump__, or perhaps a bit more explicit, like __pre_deserialize__, though that's kind of verbose; inevitably the method names are subject to change, and it might even be worth it to brainstorm to formalize on the ideal method names that we want to suggest that classes implement. I also want to provide a Mixin class, something like SerializerHookMixIn, that is an abstract class (ABC) defining the methods which we are looking for, just to aid in type hinting and autocompletion for IDEs, and also so that we can enable awareness of each method signature and any return types, for example.
List view
0 issues of 0 selected
There are no open issues in this milestone
Add issues to milestones to help organize your work for a particular release or project. Find and add issues with no milestones in this repo.