Skip to content

Conversation

@baumgold
Copy link

Attempts to fix #754 by using the Pydantic serializer when serializing a model via the CLI

@kschwab
Copy link
Contributor

kschwab commented Jan 30, 2026

+@hramezani

@baumgold this is a good idea, thanks for the PR. We just need to make sure to maintain backwards compatibility. Can you add a bool kwarg (use_serializers?) to the serialize method with the default set to False. Then you can just make dumped_model an empty dictionary if flag is not set and update dumped_field to:

dumped_field = dumped_model.get(field_name, model_default)

You will also need to add some tests.

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.

Field PlainSerializer/WrapSerializer ignored during serialization

2 participants