Open
Description
When using a parent schema the initialization value do get passed to the actual children schema.
Use case: I want to be able to bypass the classic post_load make_object
when I init a partial
schema.
@post_load
def make_object(self, data: Dict) -> object:
if self.__model__ is None or self.partial:
return data
return self.__model__(**data)
The problem is that if a use a parent OneOfSchema
the final schema is instantiated withou any init parameters. See here and here in marshmallowoneofschema/marshmallow_oneofschema/one_of_schema.py
schema = type_schema if isinstance(type_schema, Schema) else type_schema()
Metadata
Metadata
Assignees
Labels
No labels