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

Add support for custom functions on subcast. #241

Merged
merged 4 commits into from
Jan 30, 2022

Conversation

bvanelli
Copy link
Contributor

Allows users to define custom functions or extend mashmallow fields.Field class to write custom subcasts for lists, dict keys and
dict values. Before, the user was limited to the casts defined on ma.Schema.TYPE_MAPPING

Gives an alternative to solve #216, as shown on the tests.

I also made it available with callables not derived from mashmallow.fields.Field because the handy lambda functions could be used too.

bvanelli and others added 3 commits December 15, 2021 16:36
- Allows users to define custom functions or extend mashmallow
fields.Field class to write custom subcasts for lists, dict keys and
dict values.
- Gives an alternative to solve sloria#216
Copy link
Owner

@sloria sloria left a comment

Choose a reason for hiding this comment

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

Apologies for the long delay on reviewing this. This looks great! Thanks a lot

@sloria sloria enabled auto-merge (squash) January 30, 2022 18:01
@sloria sloria merged commit 9199ab5 into sloria:master Jan 30, 2022
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.

2 participants