Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass serialisation context to model_dump (fixes #1233) #1261

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

scorpp
Copy link
Contributor

@scorpp scorpp commented Aug 9, 2024

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.

Passing request in serialisation context may be useful in cases where customising serialisation is necessary.

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.
@scorpp scorpp marked this pull request as ready for review August 9, 2024 17:21
@vitalik
Copy link
Owner

vitalik commented Aug 10, 2024

Hi @scorpp

Could you as well add some test case(s) for for this ?

@vitalik vitalik merged commit f7bc7f8 into vitalik:master Aug 12, 2024
32 of 33 checks passed
@vitalik
Copy link
Owner

vitalik commented Aug 12, 2024

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants