0

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?

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.