# generated by datamodel-codegen:
#   filename:  pydantic_v2_model_rebuild_inheritance.json
#   timestamp: 2019-07-26T00:00:00+00:00

from __future__ import annotations

from pydantic import BaseModel, RootModel


class Base(BaseModel):
    next: Base | None = None


class Derived(Base):
    value: str | None = None


class Model(RootModel[Derived]):
    root: Derived


Base.model_rebuild()
Derived.model_rebuild()
