Essential Marshmallow - Nested post_load behaviour
nested_and_load.py
:
from typing import Any
from marshmallow import Schema
from marshmallow import fields
from marshmallow import post_load
def evlove(val, type_):
if type_ == 'int':
return int(val)
if type_ == 'float':
return float(val)
if type_ == 'str':
return str(val)
class DynamicYYDS(Schema):
value = fields.String()
type = fields.String