from dataclasses import dataclass
from typing import Optional

from ._BasePropertySchemaModel import BasePropertySchemaModel
from ._PropertyModel import PropertyModel
from ._SchemaPropertyTypeEnum import SchemaPropertyTypeEnum


@dataclass
class SchemaArrayPropertyModel(BasePropertySchemaModel):
    item: PropertyModel

    def to_dict(self) -> dict:
        return {
            **super().to_dict(),
            "type": SchemaPropertyTypeEnum.array,
        }
