# generated by datamodel-codegen:
#   filename:  example.json
#   timestamp: 2025-06-16T04:13:18+00:00

from __future__ import annotations

from typing import Optional, Union

from pydantic import ConfigDict, Field

from oold.model import LinkedBaseModel


class Subschema1(LinkedBaseModel):
    model_config = ConfigDict(
        json_schema_extra={"title": "Subschema1"},
    )
    subprop0: Optional[str] = Field(
        None, json_schema_extra={"custom_key": "custom_value_0"}
    )
    subprop1: Optional[str] = Field(
        None, json_schema_extra={"custom_key": "custom_value_1"}
    )


class Subschema2(LinkedBaseModel):
    model_config = ConfigDict(
        json_schema_extra={"title": "Subschema2"},
    )
    subprop0: Optional[str] = Field(
        None, json_schema_extra={"custom_key": "custom_value_0"}
    )
    subprop2: Optional[str] = Field(
        None, json_schema_extra={"custom_key": "custom_value_2"}
    )


class Example(LinkedBaseModel):
    model_config = ConfigDict(
        json_schema_extra={"title": "Example"},
    )
    type: Optional[str] = ["example"]
    prop1: Optional[str] = Field(None, json_schema_extra={"custom_key": "custom_value"})
    prop2: Optional[Union[Subschema1, Subschema2]] = Field(
        None, json_schema_extra={"custom_key": "custom_value"}
    )
