Skip to content

Add support for custom functions on subcast.#241

Merged
sloria merged 4 commits intosloria:masterfrom
bvanelli:216-fix-subcasts
Jan 30, 2022
Merged

Add support for custom functions on subcast.#241
sloria merged 4 commits intosloria:masterfrom
bvanelli:216-fix-subcasts

Conversation

@bvanelli
Copy link
Copy Markdown
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 #216
Copy link
Copy Markdown
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