I want a Marshmallow Schema
with the following output json -
{
"_id": "aae216334c3611e78a3e06148752fd79",
"_time": 20.79606056213379,
"more_data" : {...}
}
Marshmallow doesn't serialize private members so this is as close as I can get -
class ApiSchema(Schema):
class Meta:
strict = True
time = fields.Number()
id = fields.String()
But I do need the underscores in the output json.
Is there a way to tell Marshmallow to serialize the fields using different names?