Skip to content

All json serialization does so to ConfigDescriptor (WIP)#246

Draft
jamienoss wants to merge 1 commit intomainfrom
213-nested-config-rebuild
Draft

All json serialization does so to ConfigDescriptor (WIP)#246
jamienoss wants to merge 1 commit intomainfrom
213-nested-config-rebuild

Conversation

@jamienoss
Copy link
Copy Markdown
Contributor

Resolves #213

Signed-off-by: James Noss <jnoss@jhu.edu>
@jamienoss jamienoss self-assigned this Jan 23, 2025
Comment thread evolver/base.py
Comment on lines +110 to +116
@pydantic.model_serializer(mode="wrap", when_used='json')
def to_descriptor(self, handler) -> dict:
serialized_by_super = handler(self)
class_info = self.get_classinfo()
if class_info is None or _is_descriptor_dict(serialized_by_super):
return serialized_by_super
return dict(classinfo=class_info, config=serialized_by_super)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amitschang This is the serializer. Most of the other changes in this PR might be temp and I just committed and pushed what I had.

@jamienoss jamienoss removed their assignment Feb 19, 2025
@jamienoss
Copy link
Copy Markdown
Contributor Author

@amitschang feel free to close this or keep it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in nested rebuilding of Config as ConfigDescriptor

1 participant