Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Order of pre-processing and reading data into dict #179
Currently, preprocessors are called after the output dictionary is constructed. This makes it impossible to e.g. unwrap the namespacing operation given in the examples purely within a deserializer, as far as I can tell.
It's also surprising that the preprocessor runs before output dictionary construction, because this makes it not parallel postprocessors on
Thanks @taion for reporting.
Preprocessors are executed prior to validation and passing to
I looked at that issue. I think I'm concerned about something different.
My concern is that there's no pluggable step in deserialization that happens before the deserialization of individual fields. The current pipeline for deserialization looks like:
By contrast, the pipeline for serialization looks like:
I believe @davidism is talking about adding something before (1) above in serialization. My concern is different - it's that there's nothing before (1) in deserialization, that can reverse the effect of a data handler.
For example, I can't reverse the effects of the data handler in the example with a preprocessor: http://marshmallow.readthedocs.org/en/latest/extending.html#transforming-data
Additionally, because preprocessing is done on