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

fix: pydantic cannot validate asdf TaggedDict, casting to native dict #41

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

ketozhang
Copy link
Owner

@ketozhang ketozhang commented Nov 18, 2024

ASDF passes TaggedDict as YAML tree node to converter. Due to its multiple-inheritance implementation (UserDict, dict), Pydantic does not properly validate it and gives missing field errors.

ASDF passes TaggedDict as YAML tree node to converter. Due to its
multiple-inheritance implementation (UserDict, dict), Pydantic does not
properly validate it and gives missing field errors. Here we convert all nodes
to simple dicts before validating.
@ketozhang ketozhang self-assigned this Nov 18, 2024
@ketozhang ketozhang force-pushed the fix-converter-pydantic-incompatible-with-tagged-dict branch from 1adabfa to 6bb80d8 Compare November 18, 2024 21:42
@ketozhang ketozhang merged commit 09f56ec into main Nov 18, 2024
6 checks passed
@ketozhang ketozhang deleted the fix-converter-pydantic-incompatible-with-tagged-dict branch November 18, 2024 21:43
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.

1 participant