Why is erdantic now showing one to many / list relationships?

91 Views Asked by At

When using erdantic with pydantic model, the one to many relationships are not rendered properly

As shown below the erdantic examples work as expected, however the simple example I have shown is not rendered correctly. I can't see the difference between the A class I have written and the party example. Any help much appreciated!

import erdantic as erd
from erdantic.examples.pydantic import Party

# Easy one-liner
erd.draw(Party, out="diagram.png")


class B(BaseModel):
    """
    B Class
    """

    id: str


class A(BaseModel):
    """
    A Class
    """

    list_b: List[B]


erd.draw(A, out="A.jpg")

A.jpg A.jpg

diagram.jpg diagram.jpg

0

There are 0 best solutions below