mansenfranzen / autodoc_pydantic

Seamlessly integrate pydantic models in your Sphinx documentation.
MIT License
159 stars 27 forks source link

Model inherited from two parents does not seem to show inherited members #208

Closed goroderickgo closed 8 months ago

goroderickgo commented 8 months ago

I have a case where one of my pydantic models is inheriting from two parents, and I don't think autodoc-pydantic is rendering the inherited fields:

  1. In the case like the example below, where the child has no fields of its own, the autoclass is empty
  2. If the child model has its own fields, autodoc only seems to renders those defined directly on that child

from pydantic import BaseModel

class MyFirstParent(BaseModel):
    x: str
    y: int

class MySecondParent(BaseModel):
    z: str

class MyFirstAlias(MyFirstParent, MySecondParent):
    pass
goroderickgo commented 8 months ago

Never mind! Figured out it was an unrelated build issue causing this