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

custom key types when saving dict #28

Open
mivanit opened this issue Apr 22, 2023 · 0 comments
Open

custom key types when saving dict #28

mivanit opened this issue Apr 22, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@mivanit
Copy link
Owner

mivanit commented Apr 22, 2023

JSON only supports strings as dict keys, and this casting is done automatically. It would be good to have some way to specify a "key loader" type, perhaps in the type annotation of a SerializableDataclass which allows the user to specify what the keys of a dict should be cast to when loading it from JSON.

@mivanit mivanit added the enhancement New feature or request label Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant