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

Enable contexts for serialization #10093

Closed
gshank opened this issue May 6, 2024 · 0 comments · Fixed by #10094
Closed

Enable contexts for serialization #10093

gshank opened this issue May 6, 2024 · 0 comments · Fixed by #10094
Assignees

Comments

@gshank
Copy link
Contributor

gshank commented May 6, 2024

Description

In some cases we'd like to serialize differently for creating artifacts and saving the internal manifest (and possibly other purposes too). Mashumaro has a feature to enable passing along a context dictionary to pre_serialize and post_serialize calls.

Acceptance Criteria

We can use a context parameter in to_dict calls: obj.to_dict(context={"test": True}).

Impact to other teams

We need to change the signature of all pre_ and post_serialize calls, so we need to verify that nobody else is using these.

Will backports be required

No

Context

@gshank gshank self-assigned this May 6, 2024
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 a pull request may close this issue.

1 participant