-
Notifications
You must be signed in to change notification settings - Fork 77
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
Use TYPE_MAPPING from base_schema #72
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me ! Could you just add one line in the README about this new feature ? Maybe in the Customizing the base Schema section.
Thanks for merging! Shall I open a new PR for the README? |
Ok, I saw your own commit. Thanks for updating the README! |
Yes, I updated the README. Thank you for your contribution @MartinAltmayer ! I am going to update the changelog and publish a new release. |
Hmm... I'm thinking: my example may be super confusing. class BaseSchema(marshmallow.Schema):
TYPE_MAPPING = {CustomType: CustomField} creates a schema where none of the default type mappings apply. This is probably never what anyone wants. |
Should we update our code to use |
I'd love to hear your opinion @sloria ! |
I implemented the first solution. I'll release it once I'm sure everyone agrees. @sloria , @MartinAltmayer ? |
Looks fine to me, the user probably never wants to remove the default mapping. |
Ok, I'll publish that this weekend if no one opposes in the meantime. |
Yeah, the implemented behavior seems reasonable to me |
OK, it's deployed: https://pypi.org/project/marshmallow-dataclass/ |
I ran the tests with Python 3.6.10, 3.7.7, and 3.8.1. I also tested this branch in my application which uses Python 3.8.1.