I'm using marshmallow to serialize my objects to JSON and just realized that the output in ModelSerializer(model).data
is equal to ModelSerializer().dump(model).data
Is there any difference between them?
I'm using marshmallow to serialize my objects to JSON and just realized that the output in ModelSerializer(model).data
is equal to ModelSerializer().dump(model).data
Is there any difference between them?
ModelSerializer(model).data
is deprecated API. Use ModelSerializer().dump(model).data
instead.
https://marshmallow.readthedocs.org/en/latest/upgrading.html#module-marshmallow
In version 2.0, the legacy API will be completely removed.