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

Allow custom BaseSchema #26

Closed
manmime opened this issue Sep 11, 2019 · 2 comments
Closed

Allow custom BaseSchema #26

manmime opened this issue Sep 11, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@manmime
Copy link
Contributor

manmime commented Sep 11, 2019

Without marshmallow_dataclass:
I have my own BaseSchema, that (not only) converts all snake_case variable names to their camelCase alternatives when dumping. All my others schemas inherit from that.
I want to get rid of boilerplate schemas for my dataclasses and use this library, but i can't find a way to do so.

My idea:
With marshmallow_dataclass:
It would be great, if
PersonSchema = marshmallow_dataclass.class_schema(Person) had a parameter base_class=MyBaseClass

@lovasoa lovasoa added the enhancement New feature or request label Sep 11, 2019
@lovasoa
Copy link
Owner

lovasoa commented Sep 11, 2019

Looks like a useful new feature. @manmime, would you be interested in making a pull request for that ?

You would have to update _base_schema, and add an optional parameter to dataclass, add_schema and class_schema

@lovasoa
Copy link
Owner

lovasoa commented Sep 18, 2019

Fixed by #28

@lovasoa lovasoa closed this as completed Sep 18, 2019
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

2 participants