Closed scorpp closed 1 month ago
Pydantic starting with 2.7 added support for context param in model_dump and model_dump_json allowing to pass arbitrary additional data into custom serializers.
model_dump
model_dump_json
Passing request in serialisation context may be useful in cases where customising serialisation is necessary.
Hi @scorpp
Could you as well add some test case(s) for for this ?
Thank you
Pydantic starting with 2.7 added support for context param in
model_dump
andmodel_dump_json
allowing to pass arbitrary additional data into custom serializers.Passing request in serialisation context may be useful in cases where customising serialisation is necessary.