Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Question on use with inherited classes #138

Open
richard-moss opened this issue Sep 25, 2020 · 0 comments
Open

Question on use with inherited classes #138

richard-moss opened this issue Sep 25, 2020 · 0 comments

Comments

@richard-moss
Copy link

I checked out the test entry for inherited classes and noted that the mixin is only included with the parent class:

def test_inherited_schema():
    @dataclass
    class Pet(JsonSchemaMixin):
        """A generic pet"""
        name: str

    @dataclass
    class Cat(Pet):
        """A cat"""
        hunting_skill: str

I tested including the mixin in both the parent and child classes (so also including it in Cat above), and it still seems to work correctly - but I'm wondering is that a problem that you should avoid doing, or is that OK?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant